diff options
718 files changed, 3010 insertions, 1798 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ed5de10..545177b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -226,6 +226,17 @@ option(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) mark_as_advanced(CMAKE_USE_FOLDERS) +option(CMake_RUN_IWYU "Run include-what-you-use with the compiler." OFF) +if(CMake_RUN_IWYU) + find_program(IWYU_COMMAND NAMES include-what-you-use iwyu) + if(NOT IWYU_COMMAND) + message(FATAL_ERROR "CMake_RUN_IWYU is ON but include-what-you-use is not found!") + endif() + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE + "${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp") +endif() + + #----------------------------------------------------------------------- # a macro that only sets the FOLDER target property if it's # "appropriate" diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 434f0f4..e219763 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -25,6 +25,7 @@ To contribute patches: #. Fork the upstream `CMake Repository`_ into a personal account. #. Run `Utilities/SetupForDevelopment.sh`_ for local configuration. +#. See the `CMake Source Code Guide`_ for coding guidelines. #. Base all new work on the upstream ``master`` branch. #. Create commits making incremental, distinct, logically complete changes. #. Push a topic branch to a personal repository fork on GitLab. @@ -35,20 +36,9 @@ The merge request will enter the `CMake Review Process`_ for consideration. .. _`Kitware's GitLab Instance`: https://gitlab.kitware.com .. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake .. _`Utilities/SetupForDevelopment.sh`: Utilities/SetupForDevelopment.sh +.. _`CMake Source Code Guide`: Help/dev/source.rst .. _`CMake Review Process`: Help/dev/review.rst -Code Style -========== - -We use `clang-format`_ to define our style for C++ code in the CMake source -tree. See the `.clang-format`_ configuration file for our style settings. -Use ``clang-format`` version 3.8 or higher to format source files. -See also the `Utilities/Scripts/clang-format.bash`_ script. - -.. _`clang-format`: http://clang.llvm.org/docs/ClangFormat.html -.. _`.clang-format`: .clang-format -.. _`Utilities/Scripts/clang-format.bash`: Utilities/Scripts/clang-format.bash - License ======= diff --git a/CompileFlags.cmake b/CompileFlags.cmake index c875e6f..d70e3af 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -4,10 +4,6 @@ #----------------------------------------------------------------------------- # set some special flags for different compilers # -if(CMAKE_GENERATOR MATCHES "Visual Studio 7") - set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -endif() - if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel") set(_INTEL_WINDOWS 1) endif() diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt index bd4d295..2f27764 100644 --- a/Help/command/FIND_XXX.txt +++ b/Help/command/FIND_XXX.txt @@ -73,6 +73,7 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: 1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a ``-DVAR=value``. + The values are interpreted as :ref:`;-lists <CMake Language Lists>`. This can be skipped if ``NO_CMAKE_PATH`` is passed. * |CMAKE_PREFIX_PATH_XXX| @@ -80,7 +81,9 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: * |CMAKE_XXX_MAC_PATH| 2. Search paths specified in cmake-specific environment variables. - These are intended to be set in the user's shell configuration. + These are intended to be set in the user's shell configuration, + and therefore use the host's native path separator + (``;`` on Windows and ``:`` on UNIX). This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed. * |CMAKE_PREFIX_PATH_XXX| diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst index 80e7edf..d038406 100644 --- a/Help/command/add_custom_command.rst +++ b/Help/command/add_custom_command.rst @@ -215,7 +215,7 @@ of the following is specified: ``PRE_BUILD`` Run before any other rules are executed within the target. - This is supported only on Visual Studio 7 or later. + This is supported only on Visual Studio 8 or later. For all other generators ``PRE_BUILD`` will be treated as ``PRE_LINK``. ``PRE_LINK`` diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst index af75a39..3a76040 100644 --- a/Help/command/add_library.rst +++ b/Help/command/add_library.rst @@ -64,7 +64,7 @@ Imported Libraries :: - add_library(<name> <SHARED|STATIC|MODULE|UNKNOWN> IMPORTED + add_library(<name> <SHARED|STATIC|MODULE|OBJECT|UNKNOWN> IMPORTED [GLOBAL]) An :ref:`IMPORTED library target <Imported Targets>` references a library @@ -106,10 +106,9 @@ may contain only sources that compile, header files, and other files that would not affect linking of a normal library (e.g. ``.txt``). They may contain custom commands generating such sources, but not ``PRE_BUILD``, ``PRE_LINK``, or ``POST_BUILD`` commands. Object libraries -cannot be imported, exported, installed, or linked. Some native build -systems may not like targets that have only object files, so consider -adding at least one real source file to any target that references -``$<TARGET_OBJECTS:objlib>``. +cannot be linked. Some native build systems may not like targets that +have only object files, so consider adding at least one real source file +to any target that references ``$<TARGET_OBJECTS:objlib>``. Alias Libraries ^^^^^^^^^^^^^^^ diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst index 2cb1e5f..60a77b8 100644 --- a/Help/command/find_package.rst +++ b/Help/command/find_package.rst @@ -251,6 +251,7 @@ enabled. 1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a ``-DVAR=value``. + The values are interpreted as :ref:`;-lists <CMake Language Lists>`. This can be skipped if ``NO_CMAKE_PATH`` is passed:: CMAKE_PREFIX_PATH @@ -258,7 +259,9 @@ enabled. CMAKE_APPBUNDLE_PATH 2. Search paths specified in cmake-specific environment variables. - These are intended to be set in the user's shell configuration. + These are intended to be set in the user's shell configuration, + and therefore use the host's native path separator + (``;`` on Windows and ``:`` on UNIX). This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed:: <package>_DIR diff --git a/Help/command/if.rst b/Help/command/if.rst index 2a087d0..edd343d 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -103,7 +103,8 @@ Possible expressions are: ``if(<variable|string> MATCHES regex)`` True if the given string or variable's value matches the given regular - expression. + expression. See :ref:`Regex Specification` for regex format. + ``()`` groups are captured in :variable:`CMAKE_MATCH_<n>` variables. ``if(<variable|string> LESS <variable|string>)`` True if the given string or variable's value is a valid number and less diff --git a/Help/command/install.rst b/Help/command/install.rst index 70087a4..58438b7 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -73,7 +73,7 @@ Installing Targets :: install(TARGETS targets... [EXPORT <export-name>] - [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE| + [[ARCHIVE|LIBRARY|RUNTIME|OBJECTS|FRAMEWORK|BUNDLE| PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE] [DESTINATION <dir>] [PERMISSIONS permissions...] @@ -86,10 +86,10 @@ Installing Targets ) The ``TARGETS`` form specifies rules for installing targets from a -project. There are five kinds of target files that may be installed: -``ARCHIVE``, ``LIBRARY``, ``RUNTIME``, ``FRAMEWORK``, and ``BUNDLE``. -Executables are treated as ``RUNTIME`` targets, except that those -marked with the ``MACOSX_BUNDLE`` property are treated as ``BUNDLE`` +project. There are six kinds of target files that may be installed: +``ARCHIVE``, ``LIBRARY``, ``RUNTIME``, ``OBJECTS``, ``FRAMEWORK``, and +``BUNDLE``. Executables are treated as ``RUNTIME`` targets, except that +those marked with the ``MACOSX_BUNDLE`` property are treated as ``BUNDLE`` targets on OS X. Static libraries are treated as ``ARCHIVE`` targets, except that those marked with the ``FRAMEWORK`` property are treated as ``FRAMEWORK`` targets on OS X. @@ -99,10 +99,11 @@ targets, except that those marked with the ``FRAMEWORK`` property are treated as ``FRAMEWORK`` targets on OS X. For DLL platforms the DLL part of a shared library is treated as a ``RUNTIME`` target and the corresponding import library is treated as an ``ARCHIVE`` target. -All Windows-based systems including Cygwin are DLL platforms. -The ``ARCHIVE``, ``LIBRARY``, ``RUNTIME``, and ``FRAMEWORK`` arguments -change the type of target to which the subsequent properties apply. -If none is given the installation properties apply to all target +All Windows-based systems including Cygwin are DLL platforms. Object +libraries are always treated as ``OBJECTS`` targets. +The ``ARCHIVE``, ``LIBRARY``, ``RUNTIME``, ``OBJECTS``, and ``FRAMEWORK`` +arguments change the type of target to which the subsequent properties +apply. If none is given the installation properties apply to all target types. If only one is given then only targets of that type will be installed (which can be used to install just a DLL or just an import library). @@ -165,8 +166,8 @@ the ``mySharedLib`` DLL will be installed to ``<prefix>/bin`` and The ``EXPORT`` option associates the installed target files with an export called ``<export-name>``. It must appear before any ``RUNTIME``, -``LIBRARY``, or ``ARCHIVE`` options. To actually install the export -file itself, call ``install(EXPORT)``, documented below. +``LIBRARY``, ``ARCHIVE``, or ``OBJECTS`` options. To actually install the +export file itself, call ``install(EXPORT)``, documented below. Installing a target with the :prop_tgt:`EXCLUDE_FROM_ALL` target property set to ``TRUE`` has undefined behavior. diff --git a/Help/command/project.rst b/Help/command/project.rst index 6c5ace7..139f69c 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -8,6 +8,7 @@ Set a name, version, and enable languages for the entire project. project(<PROJECT-NAME> [LANGUAGES] [<language-name>...]) project(<PROJECT-NAME> [VERSION <major>[.<minor>[.<patch>[.<tweak>]]]] + [DESCRIPTION <project-description-string>] [LANGUAGES <language-name>...]) Sets the name of the project and stores the name in the @@ -40,6 +41,10 @@ in variables Variables corresponding to unspecified versions are set to the empty string (if policy :policy:`CMP0048` is set to ``NEW``). +If optional ``DESCRIPTION`` is given, then additional :variable:`PROJECT_DESCRIPTION` +variable will be set to its argument. The argument must be a string with short +description of the project (only a few words). + Optionally you can specify which languages your project supports. Example languages are ``C``, ``CXX`` (i.e. C++), ``Fortran``, etc. By default ``C`` and ``CXX`` are enabled if no language options are diff --git a/Help/command/string.rst b/Help/command/string.rst index 698a91d..4f0c45c 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -77,31 +77,43 @@ The replace expression may refer to paren-delimited subexpressions of the match using ``\1``, ``\2``, ..., ``\9``. Note that two backslashes (``\\1``) are required in CMake code to get a backslash through argument parsing. +.. _`Regex Specification`: + Regex Specification """"""""""""""""""" The following characters have special meaning in regular expressions: -:: - - ^ Matches at beginning of input - $ Matches at end of input - . Matches any single character - [ ] Matches any character(s) inside the brackets - [^ ] Matches any character(s) not inside the brackets - - Inside brackets, specifies an inclusive range between - characters on either side e.g. [a-f] is [abcdef] - To match a literal - using brackets, make it the first - or the last character e.g. [+*/-] matches basic - mathematical operators. - * Matches preceding pattern zero or more times - + Matches preceding pattern one or more times - ? Matches preceding pattern zero or once only - | Matches a pattern on either side of the | - () Saves a matched subexpression, which can be referenced - in the REGEX REPLACE operation. Additionally it is saved - by all regular expression-related commands, including - e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9). +``^`` + Matches at beginning of input +``$`` + Matches at end of input +``.`` + Matches any single character +``[ ]`` + Matches any character(s) inside the brackets +``[^ ]`` + Matches any character(s) not inside the brackets +``-`` + Inside brackets, specifies an inclusive range between + characters on either side e.g. ``[a-f]`` is ``[abcdef]`` + To match a literal ``-`` using brackets, make it the first + or the last character e.g. ``[+*/-]`` matches basic + mathematical operators. +``*`` + Matches preceding pattern zero or more times +``+`` + Matches preceding pattern one or more times +``?`` + Matches preceding pattern zero or once only +``|`` + Matches a pattern on either side of the ``|`` +``()`` + Saves a matched subexpression, which can be referenced + in the ``REGEX REPLACE`` operation. Additionally it is saved + by all regular expression-related commands, including + e.g. :command:`if(MATCHES)`, in the variables + :variable:`CMAKE_MATCH_<n>` for ``<n>`` 0..9. ``*``, ``+`` and ``?`` have higher precedence than concatenation. ``|`` has lower precedence than concatenation. This means that the regular diff --git a/Help/dev/README.rst b/Help/dev/README.rst index 0dc512a..163be97 100644 --- a/Help/dev/README.rst +++ b/Help/dev/README.rst @@ -29,3 +29,12 @@ following documents: .. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake .. _`CMake Review Process`: review.rst .. _`CMake Testing Process`: testing.rst + +Developer Documentation +======================= + +CMake developer documentation is provided by the following documents: + +* The `CMake Source Code Guide`_. + +.. _`CMake Source Code Guide`: source.rst diff --git a/Help/dev/source.rst b/Help/dev/source.rst new file mode 100644 index 0000000..3ac9aca --- /dev/null +++ b/Help/dev/source.rst @@ -0,0 +1,42 @@ +CMake Source Code Guide +*********************** + +The following is a guide to the CMake source code for developers. +See documentation on `CMake Development`_ for more information. + +.. _`CMake Development`: README.rst + +C++ Code Style +============== + +We use `clang-format`_ version **3.8** to define our style for C++ code in +the CMake source tree. See the `.clang-format`_ configuration file for our +style settings. Use the `Utilities/Scripts/clang-format.bash`_ script to +format source code. It automatically runs ``clang-format`` on the set of +source files for which we enforce style. The script also has options to +format only a subset of files, such as those that are locally modified. + +.. _`clang-format`: http://clang.llvm.org/docs/ClangFormat.html +.. _`.clang-format`: ../../.clang-format +.. _`Utilities/Scripts/clang-format.bash`: ../../Utilities/Scripts/clang-format.bash + +C++ Subset Permitted +==================== + +CMake supports compiling as C++98 in addition to C++11 and C++14. +In order to support building on older toolchains some constructs +need to be handled with care: + +* Use ``CM_AUTO_PTR`` instead of ``std::auto_ptr``. + + The ``std::auto_ptr`` template is deprecated in C++11. We want to use it + so we can build on C++98 compilers but we do not want to turn off compiler + warnings about deprecated interfaces in general. Use the ``CM_AUTO_PTR`` + macro instead. + +* Use ``size_t`` instead of ``std::size_t``. + + Various implementations have differing implementation of ``size_t``. + When assigning the result of ``.size()`` on a container for example, + the result should be assigned to ``size_t`` not to ``std::size_t``, + ``unsigned int`` or similar types. diff --git a/Help/generator/Visual Studio 7 .NET 2003.rst b/Help/generator/Visual Studio 7 .NET 2003.rst index 1c086a0..d4c7869 100644 --- a/Help/generator/Visual Studio 7 .NET 2003.rst +++ b/Help/generator/Visual Studio 7 .NET 2003.rst @@ -1,10 +1,6 @@ Visual Studio 7 .NET 2003 ------------------------- -Deprecated. Generates Visual Studio .NET 2003 project files. - -.. note:: - This generator is deprecated and will be removed - in a future version of CMake. It will still be - possible to build with VS 7.1 tools using the - :generator:`NMake Makefiles` generator. +Removed. This once generated Visual Studio .NET 2003 project files, but +the generator has been removed since CMake 3.9. It is still possible to +build with VS 7.1 tools using the :generator:`NMake Makefiles` generator. diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index 2e6a803..95f5b87 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -125,10 +125,10 @@ The object files collection can be used as source inputs to other targets: add_executable(test_exe $<TARGET_OBJECTS:archive> test.cpp) -``OBJECT`` libraries may only be used locally as sources in a buildsystem -- -they may not be installed, exported, or used in the right hand side of +``OBJECT`` libraries may not be used in the right hand side of :command:`target_link_libraries`. They also may not be used as the ``TARGET`` -in a use of the :command:`add_custom_command(TARGET)` command signature. +in a use of the :command:`add_custom_command(TARGET)` command signature. They +may be installed, and will be exported as an INTERFACE library. Although object libraries may not be named directly in calls to the :command:`target_link_libraries` command, they can be "linked" @@ -136,6 +136,12 @@ indirectly by using an :ref:`Interface Library <Interface Libraries>` whose :prop_tgt:`INTERFACE_SOURCES` target property is set to name ``$<TARGET_OBJECTS:objlib>``. +Although object libraries may not be used as the ``TARGET`` +in a use of the :command:`add_custom_command(TARGET)` command signature, +the list of objects can be used by :command:`add_custom_command(OUTPUT)` or +:command:`file(GENERATE)` by using ``$<TARGET_OBJECTS:objlib>``. + + Build Specification and Usage Requirements ========================================== diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index f77d8c0..cd509ac 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -13,30 +13,6 @@ Introduction This manual is intended for reference by developers modifying the CMake source tree itself, and by those authoring externally-maintained modules. - -Permitted C++ Subset -==================== - -CMake is required to build with ancient C++ compilers and standard library -implementations. Some common C++ constructs may not be used in CMake in order -to build with such toolchains. - -std::auto_ptr -------------- - -The ``std::auto_ptr`` template is deprecated in C++11. We want to use it -so we can build on C++98 compilers but we do not want to turn off compiler -warnings about deprecated interfaces in general. Use the ``CM_AUTO_PTR`` -macro instead. - -size_t ------- - -Various implementations have differing implementation of ``size_t``. When -assigning the result of ``.size()`` on a container for example, the result -should be assigned to ``size_t`` not to ``std::size_t``, ``unsigned int`` or -similar types. - Adding Compile Features ======================= diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 3eac45f..bddb174 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -290,9 +290,7 @@ Available output expressions are: Content of ``...`` converted to a C identifier. ``$<TARGET_OBJECTS:objLib>`` List of objects resulting from build of ``objLib``. ``objLib`` must be an - object of type ``OBJECT_LIBRARY``. This expression may only be used in - the sources of :command:`add_library` and :command:`add_executable` - commands. + object of type ``OBJECT_LIBRARY``. ``$<SHELL_PATH:...>`` Content of ``...`` converted to shell path style. For example, slashes are converted to backslashes in Windows shells and drive letters are converted diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 27c75dc..31b2389 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -194,6 +194,8 @@ Properties on Targets /prop_tgt/IMPORTED_LOCATION /prop_tgt/IMPORTED_NO_SONAME_CONFIG /prop_tgt/IMPORTED_NO_SONAME + /prop_tgt/IMPORTED_OBJECTS_CONFIG + /prop_tgt/IMPORTED_OBJECTS /prop_tgt/IMPORTED /prop_tgt/IMPORTED_SONAME_CONFIG /prop_tgt/IMPORTED_SONAME diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index c45574f..4317f67 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -56,10 +56,12 @@ Variables that Provide Information /variable/CMAKE_MAJOR_VERSION /variable/CMAKE_MAKE_PROGRAM /variable/CMAKE_MATCH_COUNT + /variable/CMAKE_MATCH_n /variable/CMAKE_MINIMUM_REQUIRED_VERSION /variable/CMAKE_MINOR_VERSION /variable/CMAKE_PARENT_LIST_FILE /variable/CMAKE_PATCH_VERSION + /variable/CMAKE_PROJECT_DESCRIPTION /variable/CMAKE_PROJECT_NAME /variable/CMAKE_RANLIB /variable/CMAKE_ROOT @@ -97,6 +99,7 @@ Variables that Provide Information /variable/PROJECT-NAME_VERSION_PATCH /variable/PROJECT-NAME_VERSION_TWEAK /variable/PROJECT_BINARY_DIR + /variable/PROJECT_DESCRIPTION /variable/PROJECT_NAME /variable/PROJECT_SOURCE_DIR /variable/PROJECT_VERSION @@ -290,6 +293,7 @@ Variables that Control the Build /variable/CMAKE_INSTALL_RPATH /variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH /variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION + /variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG /variable/CMAKE_IOS_INSTALL_COMBINED /variable/CMAKE_LANG_CLANG_TIDY /variable/CMAKE_LANG_COMPILER_LAUNCHER diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index b2e2828..ba925e8 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -227,7 +227,7 @@ Available commands are: ``copy <file>... <destination>`` Copy files to ``<destination>`` (either file or directory). If multiple files are specified, the ``<destination>`` must be - directory and it must exist. + directory and it must exist. Wildcards are not supported. ``copy_directory <dir>... <destination>`` Copy directories to ``<destination>`` directory. diff --git a/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst b/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst index eb91832..dcd2a4e 100644 --- a/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst +++ b/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst @@ -17,7 +17,7 @@ pairs. Each such pair will be transformed into an entry in the solution global section. Whitespace around key and value is ignored. List elements which do not contain an equal sign are skipped. -This property only works for Visual Studio 7 and above; it is ignored +This property only works for Visual Studio 8 and above; it is ignored on other generators. The property only applies when set on a directory whose CMakeLists.txt contains a project() command. diff --git a/Help/prop_dir/VS_GLOBAL_SECTION_PRE_section.rst b/Help/prop_dir/VS_GLOBAL_SECTION_PRE_section.rst index fbcd9e6..200e8e6 100644 --- a/Help/prop_dir/VS_GLOBAL_SECTION_PRE_section.rst +++ b/Help/prop_dir/VS_GLOBAL_SECTION_PRE_section.rst @@ -17,6 +17,6 @@ pairs. Each such pair will be transformed into an entry in the solution global section. Whitespace around key and value is ignored. List elements which do not contain an equal sign are skipped. -This property only works for Visual Studio 7 and above; it is ignored +This property only works for Visual Studio 8 and above; it is ignored on other generators. The property only applies when set on a directory whose CMakeLists.txt contains a project() command. diff --git a/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst b/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst index 19270a5..a14e48c 100644 --- a/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst +++ b/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst @@ -3,6 +3,6 @@ EXCLUDE_FROM_DEFAULT_BUILD Exclude target from "Build Solution". -This property is only used by Visual Studio generators 7 and above. +This property is only used by Visual Studio generators. When set to TRUE, the target will not be built when you press "Build Solution". diff --git a/Help/prop_tgt/IMPORTED_OBJECTS.rst b/Help/prop_tgt/IMPORTED_OBJECTS.rst new file mode 100644 index 0000000..222e6cc --- /dev/null +++ b/Help/prop_tgt/IMPORTED_OBJECTS.rst @@ -0,0 +1,11 @@ +IMPORTED_OBJECTS +---------------- + +:ref:`;-list <CMake Language Lists>` of absolute paths to the object +files on disk for an :ref:`imported <Imported targets>` +:ref:`object library <object libraries>`. + +Ignored for non-imported targets. + +Projects may skip ``IMPORTED_OBJECTS`` if the configuration-specific +property :prop_tgt:`IMPORTED_OBJECTS_<CONFIG>` is set instead. diff --git a/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst b/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst new file mode 100644 index 0000000..4419ed1 --- /dev/null +++ b/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst @@ -0,0 +1,7 @@ +IMPORTED_OBJECTS_<CONFIG> +------------------------- + +<CONFIG>-specific version of :prop_tgt:`IMPORTED_OBJECTS` property. + +Configuration names correspond to those provided by the project from +which the target is imported. diff --git a/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst b/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst index 492fee0..782b0f0 100644 --- a/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst +++ b/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst @@ -6,3 +6,7 @@ Per-configuration interprocedural optimization for a target. This is a per-configuration version of INTERPROCEDURAL_OPTIMIZATION. If set, this property overrides the generic property for the named configuration. + +This property is initialized by the +:variable:`CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>` variable if it is set +when a target is created. diff --git a/Help/release/dev/FindMPI-add-imported-targets.rst b/Help/release/dev/FindMPI-add-imported-targets.rst new file mode 100644 index 0000000..c0a7bfc --- /dev/null +++ b/Help/release/dev/FindMPI-add-imported-targets.rst @@ -0,0 +1,4 @@ +FindMPI-add-imported-targets +------------------------------ + +* The :module:`FindMPI` module now provides imported targets. diff --git a/Help/release/dev/add_custom_command-TARGET_OBJECTS.rst b/Help/release/dev/add_custom_command-TARGET_OBJECTS.rst new file mode 100644 index 0000000..c4a9ee8 --- /dev/null +++ b/Help/release/dev/add_custom_command-TARGET_OBJECTS.rst @@ -0,0 +1,6 @@ +add_custom_command-TARGET_OBJECTS +--------------------------------- + +* The :command:`add_custom_command` command learned to evaluate the + ``TARGET_OBJECTS`` + :manual:`generator expression <cmake-generator-expressions(7)>`. diff --git a/Help/release/dev/add_library-TARGET_OBJECTS.rst b/Help/release/dev/add_library-TARGET_OBJECTS.rst new file mode 100644 index 0000000..964064e --- /dev/null +++ b/Help/release/dev/add_library-TARGET_OBJECTS.rst @@ -0,0 +1,5 @@ +add_library-TARGET_OBJECTS +-------------------------- + +* The :command:`add_library` command ``IMPORTED`` option learned to support + :ref:`Object Libraries`. diff --git a/Help/release/dev/cpackifw-search-algorithm.rst b/Help/release/dev/cpackifw-search-algorithm.rst new file mode 100644 index 0000000..f2e9985 --- /dev/null +++ b/Help/release/dev/cpackifw-search-algorithm.rst @@ -0,0 +1,7 @@ +cpackifw-search-algorithm +------------------------- + +* The :module:`CPackIFW` module learned the new hint :variable:`CPACK_IFW_ROOT` + variable for finding the QtIFW tool suite installed in a non-standard place. +* The :module:`CPackIFW` module tries to find and use QtIFW tools of the `3.0` + and `3.1` versions. diff --git a/Help/release/dev/file-GENERATE-TARGET_OBJECTS.rst b/Help/release/dev/file-GENERATE-TARGET_OBJECTS.rst new file mode 100644 index 0000000..853a803 --- /dev/null +++ b/Help/release/dev/file-GENERATE-TARGET_OBJECTS.rst @@ -0,0 +1,6 @@ +file-GENERATE-TARGET_OBJECTS +---------------------------- + +* The :command:`file(GENERATE)` subcommand learned to evaluate the + ``TARGET_OBJECTS`` + :manual:`generator expression <cmake-generator-expressions(7)>`. diff --git a/Help/release/dev/install-TARGET_OBJECTS.rst b/Help/release/dev/install-TARGET_OBJECTS.rst new file mode 100644 index 0000000..dbcf635 --- /dev/null +++ b/Help/release/dev/install-TARGET_OBJECTS.rst @@ -0,0 +1,8 @@ +install-TARGET_OBJECTS +---------------------- + +* The :command:`install(TARGETS)` command learned a new ``OBJECTS`` option to + specify where to install :ref:`Object Libraries`. + +* The :command:`install(EXPORT)` command learned how to export + :ref:`Object Libraries`. diff --git a/Help/release/dev/macos-hidpi-qt-dialog.rst b/Help/release/dev/macos-hidpi-qt-dialog.rst new file mode 100644 index 0000000..263d405 --- /dev/null +++ b/Help/release/dev/macos-hidpi-qt-dialog.rst @@ -0,0 +1,5 @@ +macos-hidpi-qt-dialog +--------------------- + +* On macOS the default application bundle ``Info.plist`` file now enables + Hi-DPI support. diff --git a/Help/release/dev/project_description.rst b/Help/release/dev/project_description.rst new file mode 100644 index 0000000..baf0045 --- /dev/null +++ b/Help/release/dev/project_description.rst @@ -0,0 +1,5 @@ +project-description +------------------- + +* The :command:`project` command learned an optional ``DESCRIPTION`` parameter. + See :command:`project` command and :variable:`PROJECT_DESCRIPTION` variable. diff --git a/Help/release/dev/remove-vs7.1-generator.rst b/Help/release/dev/remove-vs7.1-generator.rst new file mode 100644 index 0000000..72ffafb --- /dev/null +++ b/Help/release/dev/remove-vs7.1-generator.rst @@ -0,0 +1,4 @@ +remove-vs7.1-generator +---------------------- + +* The :generator:`Visual Studio 7 .NET 2003` generator has been removed. diff --git a/Help/variable/CMAKE_CFG_INTDIR.rst b/Help/variable/CMAKE_CFG_INTDIR.rst index ba25a35..c36599a 100644 --- a/Help/variable/CMAKE_CFG_INTDIR.rst +++ b/Help/variable/CMAKE_CFG_INTDIR.rst @@ -12,7 +12,7 @@ Example values: :: - $(ConfigurationName) = Visual Studio 7, 8, 9 + $(ConfigurationName) = Visual Studio 8, 9 $(Configuration) = Visual Studio 10 $(CONFIGURATION) = Xcode . = Make-based tools diff --git a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst new file mode 100644 index 0000000..b291102 --- /dev/null +++ b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst @@ -0,0 +1,8 @@ +CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG> +------------------------------------------- + +Default value for :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION_<CONFIG>` of targets. + +This variable is used to initialize the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION_<CONFIG>` +property on all the targets. See that target property for additional +information. diff --git a/Help/variable/CMAKE_MATCH_COUNT.rst b/Help/variable/CMAKE_MATCH_COUNT.rst index 8b1c036..355e834 100644 --- a/Help/variable/CMAKE_MATCH_COUNT.rst +++ b/Help/variable/CMAKE_MATCH_COUNT.rst @@ -3,6 +3,7 @@ CMAKE_MATCH_COUNT The number of matches with the last regular expression. -When a regular expression match is used, CMake fills in ``CMAKE_MATCH_<n>`` -variables with the match contents. The ``CMAKE_MATCH_COUNT`` variable holds -the number of match expressions when these are filled. +When a regular expression match is used, CMake fills in +:variable:`CMAKE_MATCH_<n>` variables with the match contents. +The ``CMAKE_MATCH_COUNT`` variable holds the number of match +expressions when these are filled. diff --git a/Help/variable/CMAKE_MATCH_n.rst b/Help/variable/CMAKE_MATCH_n.rst new file mode 100644 index 0000000..c7dd623 --- /dev/null +++ b/Help/variable/CMAKE_MATCH_n.rst @@ -0,0 +1,10 @@ +CMAKE_MATCH_<n> +--------------- + +Capture group ``<n>`` matched by the last regular expression, for groups +0 through 9. Group 0 is the entire match. Groups 1 through 9 are the +subexpressions captured by ``()`` syntax. + +When a regular expression match is used, CMake fills in ``CMAKE_MATCH_<n>`` +variables with the match contents. The :variable:`CMAKE_MATCH_COUNT` +variable holds the number of match expressions when these are filled. diff --git a/Help/variable/CMAKE_MFC_FLAG.rst b/Help/variable/CMAKE_MFC_FLAG.rst index 1543677..5a392bf 100644 --- a/Help/variable/CMAKE_MFC_FLAG.rst +++ b/Help/variable/CMAKE_MFC_FLAG.rst @@ -5,7 +5,7 @@ Tell cmake to use MFC for an executable or dll. This can be set in a ``CMakeLists.txt`` file and will enable MFC in the application. It should be set to ``1`` for the static MFC library, and ``2`` -for the shared MFC library. This is used in Visual Studio 7 +for the shared MFC library. This is used in Visual Studio project files. The CMakeSetup dialog used MFC and the ``CMakeLists.txt`` looks like this: diff --git a/Help/variable/CMAKE_PROJECT_DESCRIPTION.rst b/Help/variable/CMAKE_PROJECT_DESCRIPTION.rst new file mode 100644 index 0000000..f1911ec --- /dev/null +++ b/Help/variable/CMAKE_PROJECT_DESCRIPTION.rst @@ -0,0 +1,7 @@ +CMAKE_PROJECT_DESCRIPTION +------------------------- + +The description of the current project. + +This specifies description of the current project from the closest inherited +:command:`project` command. diff --git a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst index 14cc50a..51b42dd 100644 --- a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst +++ b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst @@ -1,7 +1,7 @@ CMAKE_VS_DEVENV_COMMAND ----------------------- -The generators for :generator:`Visual Studio 7` and above set this +The generators for :generator:`Visual Studio 8 2005` and above set this variable to the ``devenv.com`` command installed with the corresponding Visual Studio version. Note that this variable may be empty on Visual Studio Express editions because they do not provide this tool. diff --git a/Help/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION.rst b/Help/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION.rst index 0be10e5..6d196f9 100644 --- a/Help/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION.rst +++ b/Help/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION.rst @@ -1,7 +1,7 @@ CMAKE_VS_INTEL_Fortran_PROJECT_VERSION -------------------------------------- -When generating for :generator:`Visual Studio 7` or greater with the Intel +When generating for :generator:`Visual Studio 8 2005` or greater with the Intel Fortran plugin installed, this specifies the ``.vfproj`` project file format version. This is intended for internal use by CMake and should not be used by project code. diff --git a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst index e0be3a4..83b9bc1 100644 --- a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst +++ b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst @@ -10,3 +10,8 @@ version. Otherwise CMake computes a default version based on the Windows SDK versions available. The chosen Windows target version number is provided in ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION``. If no Windows 10 SDK is available this value will be empty. + +One may set a ``CMAKE_WINDOWS_KITS_10_DIR`` *environment variable* +to an absolute path to tell CMake to look for Windows 10 SDKs in +a custom location. The specified directory is expected to contain +``Include/10.0.*`` directories. diff --git a/Help/variable/PROJECT_DESCRIPTION.rst b/Help/variable/PROJECT_DESCRIPTION.rst new file mode 100644 index 0000000..05ede8f --- /dev/null +++ b/Help/variable/PROJECT_DESCRIPTION.rst @@ -0,0 +1,6 @@ +PROJECT_DESCRIPTION +------------------- + +Short project description given to the project command. + +This is the description given to the most recent :command:`project` command. diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake index 228e063..5d86d73 100644 --- a/Modules/CMakeBackwardCompatibilityC.cmake +++ b/Modules/CMakeBackwardCompatibilityC.cmake @@ -2,12 +2,6 @@ # file Copyright.txt or https://cmake.org/licensing for details. -# Nothing here yet -if(CMAKE_GENERATOR MATCHES "Visual Studio 7") - include(CMakeVS7BackwardCompatibility) - set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -endif() - if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) # Old CMake versions did not support OS X universal binaries anyway, # so just get through this with at least some size for the types. diff --git a/Modules/CMakeDetermineCSharpCompiler.cmake b/Modules/CMakeDetermineCSharpCompiler.cmake index 1b8dd02..55b2fb3 100644 --- a/Modules/CMakeDetermineCSharpCompiler.cmake +++ b/Modules/CMakeDetermineCSharpCompiler.cmake @@ -1,7 +1,7 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -if(NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio ([^789]|[789][0-9])") +if(NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio ([^89]|[89][0-9])") message(FATAL_ERROR "C# is currently only supported for Microsoft Visual Studio 2010 and later.") endif() diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index 55a6f0c..89ac9fa 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -6,7 +6,7 @@ include(${CMAKE_ROOT}/Modules//CMakeParseImplicitLinkInfo.cmake) if( NOT ( ("${CMAKE_GENERATOR}" MATCHES "Make") OR ("${CMAKE_GENERATOR}" MATCHES "Ninja") OR - ("${CMAKE_GENERATOR}" MATCHES "Visual Studio (1|[7-9][0-9])") ) ) + ("${CMAKE_GENERATOR}" MATCHES "Visual Studio (1|[89][0-9])") ) ) message(FATAL_ERROR "CUDA language not currently supported by \"${CMAKE_GENERATOR}\" generator") endif() diff --git a/Modules/CMakeVS7BackwardCompatibility.cmake b/Modules/CMakeVS7BackwardCompatibility.cmake deleted file mode 100644 index cf477c8..0000000 --- a/Modules/CMakeVS7BackwardCompatibility.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - - -# hard code these for fast backwards compatibility tests -set (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type") -set (CMAKE_SIZEOF_LONG 4 CACHE INTERNAL "Size of long data type") -set (CMAKE_SIZEOF_VOID_P 4 CACHE INTERNAL "Size of void* data type") -set (CMAKE_SIZEOF_CHAR 1 CACHE INTERNAL "Size of char data type") -set (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short data type") -set (CMAKE_SIZEOF_FLOAT 4 CACHE INTERNAL "Size of float data type") -set (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double data type") -set (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL - "Does the compiler support ansi for scope.") -set (CMAKE_USE_WIN32_THREADS TRUE CACHE BOOL "Use the win32 thread library.") -set (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes") diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 4e7546b..a63fc83 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -98,7 +98,12 @@ # # .. variable:: CPACK_PACKAGE_DESCRIPTION_SUMMARY # -# Short description of the project (only a few words). +# Short description of the project (only a few words). Default value is:: +# +# ${PROJECT_DESCRIPTION} +# +# if DESCRIPTION has given to the project() call or +# CMake generated string with PROJECT_NAME otherwise. # # .. variable:: CPACK_PACKAGE_FILE_NAME # @@ -360,8 +365,13 @@ _cpack_set_default(CPACK_PACKAGE_VERSION_PATCH "1") _cpack_set_default(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") _cpack_set_default(CPACK_PACKAGE_VENDOR "Humanity") -_cpack_set_default(CPACK_PACKAGE_DESCRIPTION_SUMMARY - "${CMAKE_PROJECT_NAME} built using CMake") +if(CMAKE_PROJECT_DESCRIPTION) + _cpack_set_default(CPACK_PACKAGE_DESCRIPTION_SUMMARY + "${CMAKE_PROJECT_DESCRIPTION}") +else() + _cpack_set_default(CPACK_PACKAGE_DESCRIPTION_SUMMARY + "${CMAKE_PROJECT_NAME} built using CMake") +endif() _cpack_set_default(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt") diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index deb724c..099dd1c 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -28,8 +28,32 @@ # and Mac OS X. # # You should also install QtIFW_ to use CPack ``IFW`` generator. -# If you don't use a default path for the installation, please set -# the used path in the variable ``QTIFWDIR``. +# +# Hints +# ^^^^^ +# +# Generally, the CPack ``IFW`` generator automatically finds QtIFW_ tools, +# but if you don't use a default path for installation of the QtIFW_ tools, +# the path may be specified in either a CMake or an environment variable: +# +# .. variable:: CPACK_IFW_ROOT +# +# An CMake variable which specifies the location of the QtIFW_ tool suite. +# +# The variable will be cached in the ``CPackConfig.cmake`` file and used at +# CPack runtime. +# +# .. variable:: QTIFWDIR +# +# An environment variable which specifies the location of the QtIFW_ tool +# suite. +# +# .. note:: +# The specified path should not contain "bin" at the end +# (for example: "D:\\DevTools\\QtIFW2.0.5"). +# +# The :variable:`CPACK_IFW_ROOT` variable has a higher priority and overrides +# the value of the :variable:`QTIFWDIR` variable. # # Variables # ^^^^^^^^^ @@ -197,7 +221,7 @@ # dependent components. # # Tools -# """""""" +# """"" # # .. variable:: CPACK_IFW_FRAMEWORK_VERSION # @@ -207,13 +231,25 @@ # # The path to "binarycreator" command line client. # -# This variable is cached and can be configured user if need. +# This variable is cached and may be configured if needed. # # .. variable:: CPACK_IFW_REPOGEN_EXECUTABLE # # The path to "repogen" command line client. # -# This variable is cached and can be configured user if need. +# This variable is cached and may be configured if needed. +# +# .. variable:: CPACK_IFW_INSTALLERBASE_EXECUTABLE +# +# The path to "installerbase" installer executable base. +# +# This variable is cached and may be configured if needed. +# +# .. variable:: CPACK_IFW_DEVTOOL_EXECUTABLE +# +# The path to "devtool" command line client. +# +# This variable is cached and may be configured if needed. # # Commands # ^^^^^^^^^ @@ -568,7 +604,7 @@ # Default path -foreach(_CPACK_IFW_PATH_VAR "QTIFWDIR" "QTDIR") +foreach(_CPACK_IFW_PATH_VAR "CPACK_IFW_ROOT" "QTIFWDIR" "QTDIR") if(DEFINED ${_CPACK_IFW_PATH_VAR} AND NOT "${${_CPACK_IFW_PATH_VAR}}" STREQUAL "") list(APPEND _CPACK_IFW_PATHS "${${_CPACK_IFW_PATH_VAR}}") @@ -597,6 +633,10 @@ set(_CPACK_IFW_PREFIXES "QtIFW-") set(_CPACK_IFW_VERSIONS + "3.1" + "3.1.0" + "3.0" + "3.0.0" "2.3" "2.3.0" "2.2" @@ -604,6 +644,7 @@ set(_CPACK_IFW_VERSIONS "2.1" "2.1.0" "2.0" + "2.0.5" "2.0.3" "2.0.2" "2.0.1" diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index 7aeb5be..9370596 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -54,15 +54,11 @@ in the ``CTestConfig.cmake`` file. option(BUILD_TESTING "Build the testing tree." ON) # function to turn generator name into a version string -# like vs7 vs71 vs8 vs9 +# like vs8 vs9 function(GET_VS_VERSION_STRING generator var) string(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" NUMBER "${generator}") - if("${generator}" MATCHES "Visual Studio 7 .NET 2003") - set(ver_string "vs71") - else() set(ver_string "vs${NUMBER}") - endif() set(${var} ${ver_string} PARENT_SCOPE) endfunction() diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index 8fecc57..6f1afcf 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -1,38 +1,47 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -#.rst: -# CheckSymbolExists -# ----------------- -# -# Check if a symbol exists as a function, variable, or macro -# -# CHECK_SYMBOL_EXISTS(<symbol> <files> <variable>) -# -# Check that the <symbol> is available after including given header -# <files> and store the result in a <variable>. Specify the list of -# files in one argument as a semicolon-separated list. -# <variable> will be created as an internal cache variable. -# -# If the header files define the symbol as a macro it is considered -# available and assumed to work. If the header files declare the symbol -# as a function or variable then the symbol must also be available for -# linking. If the symbol is a type or enum value it will not be -# recognized (consider using CheckTypeSize or CheckCSourceCompiles). If -# the check needs to be done in C++, consider using -# CHECK_CXX_SYMBOL_EXISTS(), which does the same as -# CHECK_SYMBOL_EXISTS(), but in C++. -# -# The following variables may be set before calling this macro to modify -# the way the check is run: -# -# :: -# -# CMAKE_REQUIRED_FLAGS = string of compile command line flags -# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) -# CMAKE_REQUIRED_INCLUDES = list of include directories -# CMAKE_REQUIRED_LIBRARIES = list of libraries to link -# CMAKE_REQUIRED_QUIET = execute quietly without messages +#[=======================================================================[.rst: +CheckSymbolExists +----------------- + +Provides a macro to check if a symbol exists as a function, variable, +or macro in ``C``. + +.. command:: check_symbol_exists + + :: + + check_symbol_exists(<symbol> <files> <variable>) + + Check that the ``<symbol>`` is available after including given header + ``<files>`` and store the result in a ``<variable>``. Specify the list + of files in one argument as a semicolon-separated list. + ``<variable>`` will be created as an internal cache variable. + +If the header files define the symbol as a macro it is considered +available and assumed to work. If the header files declare the symbol +as a function or variable then the symbol must also be available for +linking (so intrinsics may not be detected). +If the symbol is a type, enum value, or intrinsic it will not be recognized +(consider using :module:`CheckTypeSize` or :module:`CheckCSourceCompiles`). +If the check needs to be done in C++, consider using +:module:`CheckCXXSymbolExists` instead. + +The following variables may be set before calling this macro to modify +the way the check is run: + +``CMAKE_REQUIRED_FLAGS`` + string of compile command line flags +``CMAKE_REQUIRED_DEFINITIONS`` + list of macros to define (-DFOO=bar) +``CMAKE_REQUIRED_INCLUDES`` + list of include directories +``CMAKE_REQUIRED_LIBRARIES`` + list of libraries to link +``CMAKE_REQUIRED_QUIET`` + execute quietly without messages +#]=======================================================================] macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE) if(CMAKE_C_COMPILER_LOADED) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index c3cf341..093d8c9 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -896,7 +896,7 @@ endfunction() # This function would append corresponding directories if MSVC is a current compiler, # so having `BOOST_ROOT` would be enough to specify to find everything. # -macro(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS componentlibvar basedir) +function(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS componentlibvar basedir) if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(_arch_suffix 64) @@ -919,8 +919,9 @@ macro(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS componentlib elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14) list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-8.0) endif() + set(${componentlibvar} ${${componentlibvar}} PARENT_SCOPE) endif() -endmacro() +endfunction() # # End functions/macros diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index ff2c4de..3e8be5b 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -29,6 +29,12 @@ # MPI_<lang>_LINK_FLAGS Linking flags for MPI programs # MPI_<lang>_LIBRARIES All libraries to link MPI programs against # +# Additionally, the following :prop_tgt:`IMPORTED` targets are defined: +# +# :: +# +# MPI::MPI_<lang> Target for using MPI from <lang> +# # Additionally, FindMPI sets the following variables for running MPI # programs from the command line: # @@ -621,6 +627,29 @@ foreach (lang C CXX Fortran) else() find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_LIBRARIES MPI_${lang}_INCLUDE_PATH) endif() + + if(MPI_${lang}_FOUND) + if(NOT TARGET MPI::MPI_${lang}) + add_library(MPI::MPI_${lang} INTERFACE IMPORTED) + endif() + if(MPI_${lang}_COMPILE_FLAGS) + set(_MPI_${lang}_COMPILE_OPTIONS "${MPI_${lang}_COMPILE_FLAGS}") + separate_arguments(_MPI_${lang}_COMPILE_OPTIONS) + set_property(TARGET MPI::MPI_${lang} PROPERTY + INTERFACE_COMPILE_OPTIONS "${_MPI_${lang}_COMPILE_OPTIONS}") + endif() + + unset(_MPI_${lang}_LINK_LINE) + if(MPI_${lang}_LINK_FLAGS) + list(APPEND _MPI_${lang}_LINK_LINE "${MPI_${lang}_LINK_FLAGS}") + endif() + list(APPEND _MPI_${lang}_LINK_LINE "${MPI_${lang}_LIBRARIES}") + set_property(TARGET MPI::MPI_${lang} PROPERTY + INTERFACE_LINK_LIBRARIES "${_MPI_${lang}_LINK_LINE}") + + set_property(TARGET MPI::MPI_${lang} PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${MPI_${lang}_INCLUDE_PATH}") + endif() endif() endforeach() @@ -660,6 +689,7 @@ if (MPI_NUMLIBS GREATER 1) else() set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE) endif() +mark_as_advanced(MPI_LIBRARY MPI_EXTRA_LIBRARY) #============================================================================= # unset these vars to cleanup namespace diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 117811c..1209560 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -145,6 +145,7 @@ if(WIN32 AND NOT CYGWIN) find_library(LIB_EAY_DEBUG NAMES libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d + libcrypto${_OPENSSL_MSVC_RT_MODE}d libcryptod libeay32${_OPENSSL_MSVC_RT_MODE}d libeay32d @@ -157,6 +158,7 @@ if(WIN32 AND NOT CYGWIN) find_library(LIB_EAY_RELEASE NAMES libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE} + libcrypto${_OPENSSL_MSVC_RT_MODE} libcrypto libeay32${_OPENSSL_MSVC_RT_MODE} libeay32 @@ -170,6 +172,7 @@ if(WIN32 AND NOT CYGWIN) find_library(SSL_EAY_DEBUG NAMES libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d + libssl${_OPENSSL_MSVC_RT_MODE}d libssld ssleay32${_OPENSSL_MSVC_RT_MODE}d ssleay32d @@ -182,6 +185,7 @@ if(WIN32 AND NOT CYGWIN) find_library(SSL_EAY_RELEASE NAMES libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE} + libssl${_OPENSSL_MSVC_RT_MODE} libssl ssleay32${_OPENSSL_MSVC_RT_MODE} ssleay32 diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index a3478a3..6d33fc6 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -31,6 +31,11 @@ # app-local deployment (e.g. to Windows XP). This is meaningful # only with MSVC from Visual Studio 2015 or higher. # +# One may set a ``CMAKE_WINDOWS_KITS_10_DIR`` *environment variable* +# to an absolute path to tell CMake to look for Windows 10 SDKs in +# a custom location. The specified directory is expected to contain +# ``Redist/ucrt/DLLs/*`` directories. +# # ``CMAKE_INSTALL_MFC_LIBRARIES`` # Set to TRUE to install the MSVC MFC runtime libraries. # @@ -258,6 +263,7 @@ if(MSVC) set(programfilesx86 "ProgramFiles(x86)") find_path(WINDOWS_KITS_DIR NAMES Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll PATHS + $ENV{CMAKE_WINDOWS_KITS_10_DIR} "${windows_kits_dir}" "$ENV{ProgramFiles}/Windows Kits/10" "$ENV{${programfilesx86}}/Windows Kits/10" diff --git a/Modules/MacOSXBundleInfo.plist.in b/Modules/MacOSXBundleInfo.plist.in index a4009bc..e06b17e 100644 --- a/Modules/MacOSXBundleInfo.plist.in +++ b/Modules/MacOSXBundleInfo.plist.in @@ -30,5 +30,9 @@ <true/> <key>NSHumanReadableCopyright</key> <string>${MACOSX_BUNDLE_COPYRIGHT}</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> + <key>NSHighResolutionCapable</key> + <string>True</string> </dict> </plist> diff --git a/Modules/Platform/Linux-TinyCC-C.cmake b/Modules/Platform/Linux-TinyCC-C.cmake index f78e708..9409d8b 100644 --- a/Modules/Platform/Linux-TinyCC-C.cmake +++ b/Modules/Platform/Linux-TinyCC-C.cmake @@ -2,3 +2,4 @@ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "") set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-soname ") +set(CMAKE_EXE_EXPORTS_C_FLAG "-rdynamic ") diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake index b31cb11..c59be45 100644 --- a/Modules/Platform/Windows-df.cmake +++ b/Modules/Platform/Windows-df.cmake @@ -30,7 +30,7 @@ set(CMAKE_Fortran_LINK_EXECUTABLE set(CMAKE_CREATE_WIN32_EXE /winapp) set(CMAKE_CREATE_CONSOLE_EXE ) -if(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") +if(CMAKE_GENERATOR MATCHES "Visual Studio 8") set (CMAKE_NO_BUILD_TYPE 1) endif() # does the compiler support pdbtype and is it the newer compiler diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 59920f8..8d683cb3f 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -889,6 +889,12 @@ add_library(CTestLib ${CTEST_SRCS}) target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) # +# CPack +# +include_directories( + "${CMake_SOURCE_DIR}/Source/CPack" + ) +# # Sources for CPack # set(CPACK_SRCS diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8e5c743..ea6e0e2 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 8) -set(CMake_VERSION_PATCH 20170412) +set(CMake_VERSION_PATCH 20170421) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index ee46d86..fa8982f 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -2,12 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackIFWGenerator.h" -#include "CPack/cmCPackComponentGroup.h" -#include "CPack/cmCPackGenerator.h" -#include "CPack/cmCPackLog.h" +#include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" #include "cmCPackIFWInstaller.h" #include "cmCPackIFWPackage.h" #include "cmCPackIFWRepository.h" +#include "cmCPackLog.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include "cmTimestamp.h" diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.h b/Source/CPack/IFW/cmCPackIFWGenerator.h index d656063..688db4b 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.h +++ b/Source/CPack/IFW/cmCPackIFWGenerator.h @@ -3,10 +3,10 @@ #ifndef cmCPackIFWGenerator_h #define cmCPackIFWGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include "CPack/cmCPackComponentGroup.h" -#include "CPack/cmCPackGenerator.h" +#include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" #include "cmCPackIFWInstaller.h" #include "cmCPackIFWPackage.h" #include "cmCPackIFWRepository.h" diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index d8bafee..3aebbc8 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -2,16 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackIFWInstaller.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <sstream> #include <stddef.h> #include <utility> -#include "CPack/cmCPackGenerator.h" -#include "CPack/cmCPackLog.h" +#include "cmCPackGenerator.h" #include "cmCPackIFWGenerator.h" #include "cmCPackIFWPackage.h" #include "cmCPackIFWRepository.h" +#include "cmCPackLog.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include "cmXMLParser.h" diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h index 4ec3e70..64239cf 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.h +++ b/Source/CPack/IFW/cmCPackIFWInstaller.h @@ -3,7 +3,7 @@ #ifndef cmCPackIFWInstaller_h #define cmCPackIFWInstaller_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index e23b1b9..2a95ba8 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -2,17 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackIFWPackage.h" -#include "CPack/cmCPackComponentGroup.h" -#include "CPack/cmCPackGenerator.h" -#include "CPack/cmCPackLog.h" +#include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" #include "cmCPackIFWGenerator.h" #include "cmCPackIFWInstaller.h" +#include "cmCPackLog.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include "cmTimestamp.h" #include "cmXMLWriter.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <map> #include <sstream> #include <stddef.h> diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h index bd1d6c5..025a03e 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.h +++ b/Source/CPack/IFW/cmCPackIFWPackage.h @@ -3,7 +3,7 @@ #ifndef cmCPackIFWPackage_h #define cmCPackIFWPackage_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <set> #include <string> diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx index cc204e8..8ce375e 100644 --- a/Source/CPack/IFW/cmCPackIFWRepository.cxx +++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx @@ -2,14 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackIFWRepository.h" -#include "CPack/cmCPackGenerator.h" +#include "cmCPackGenerator.h" #include "cmCPackIFWGenerator.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include "cmXMLParser.h" #include "cmXMLWriter.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <stddef.h> #ifdef cmCPackLogger diff --git a/Source/CPack/IFW/cmCPackIFWRepository.h b/Source/CPack/IFW/cmCPackIFWRepository.h index 36f46da..c09a158 100644 --- a/Source/CPack/IFW/cmCPackIFWRepository.h +++ b/Source/CPack/IFW/cmCPackIFWRepository.h @@ -3,7 +3,7 @@ #ifndef cmCPackIFWRepository_h #define cmCPackIFWRepository_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx index aeabde9..b48bf12 100644 --- a/Source/CPack/OSXScriptLauncher.cxx +++ b/Source/CPack/OSXScriptLauncher.cxx @@ -1,8 +1,8 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include <cmsys/FStream.hxx> -#include <cmsys/Process.h> -#include <cmsys/SystemTools.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/Process.h" +#include "cmsys/SystemTools.hxx" #include <iostream> #include <stddef.h> #include <string> @@ -85,8 +85,6 @@ int main(int argc, char* argv[]) int length; while (cmsysProcess_WaitForData(cp, &data, &length, 0)) { // Translate NULL characters in the output into valid text. - // Visual Studio 7 puts these characters in the output of its - // build process. for (int i = 0; i < length; ++i) { if (data[i] == '\0') { data[i] = ' '; diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 39586de..2df23fd 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -2,14 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackWIXGenerator.h" -#include <CPack/cmCPackComponentGroup.h> -#include <CPack/cmCPackLog.h> +#include "cmCPackComponentGroup.h" +#include "cmCPackLog.h" +#include "cmCryptoHash.h" +#include "cmGeneratedFileStream.h" +#include "cmInstalledFile.h" +#include "cmSystemTools.h" +#include "cmUuid.h" #include <algorithm> -#include <cmCryptoHash.h> -#include <cmGeneratedFileStream.h> -#include <cmInstalledFile.h> -#include <cmSystemTools.h> -#include <cmUuid.h> #include "cmWIXDirectoriesSourceWriter.h" #include "cmWIXFeaturesSourceWriter.h" @@ -17,10 +17,10 @@ #include "cmWIXRichTextFormatWriter.h" #include "cmWIXSourceWriter.h" -#include <cmsys/Directory.hxx> -#include <cmsys/Encoding.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/SystemTools.hxx> +#include "cmsys/Directory.hxx" +#include "cmsys/Encoding.hxx" +#include "cmsys/FStream.hxx" +#include "cmsys/SystemTools.hxx" #include <rpc.h> // for GUID generation diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h index 36647d8..353d6c0 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.h +++ b/Source/CPack/WiX/cmCPackWIXGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackWIXGenerator_h #define cmCPackWIXGenerator_h -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" #include "cmWIXPatch.h" #include "cmWIXShortcut.h" diff --git a/Source/CPack/WiX/cmWIXAccessControlList.cxx b/Source/CPack/WiX/cmWIXAccessControlList.cxx index 9f9b39c..744a932 100644 --- a/Source/CPack/WiX/cmWIXAccessControlList.cxx +++ b/Source/CPack/WiX/cmWIXAccessControlList.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWIXAccessControlList.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" -#include <cmSystemTools.h> +#include "cmSystemTools.h" cmWIXAccessControlList::cmWIXAccessControlList( cmCPackLog* logger, cmInstalledFile const& installedFile, diff --git a/Source/CPack/WiX/cmWIXAccessControlList.h b/Source/CPack/WiX/cmWIXAccessControlList.h index 0a25ee5..2a23f2f 100644 --- a/Source/CPack/WiX/cmWIXAccessControlList.h +++ b/Source/CPack/WiX/cmWIXAccessControlList.h @@ -5,8 +5,8 @@ #include "cmWIXSourceWriter.h" -#include <CPack/cmCPackLog.h> -#include <cmInstalledFile.h> +#include "cmCPackLog.h" +#include "cmInstalledFile.h" class cmWIXAccessControlList { diff --git a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h index 062efe3..8233331 100644 --- a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h @@ -5,7 +5,7 @@ #include "cmWIXSourceWriter.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" #include <string> diff --git a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h index 368b250..e751ca7 100644 --- a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h @@ -6,7 +6,7 @@ #include "cmWIXPatch.h" #include "cmWIXSourceWriter.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" /** \class cmWIXFeaturesSourceWriter * \brief Helper class to generate features.wxs diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx index 3158343..7aa1212 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx @@ -4,10 +4,10 @@ #include "cmWIXAccessControlList.h" -#include <cmInstalledFile.h> +#include "cmInstalledFile.h" -#include <cmSystemTools.h> -#include <cmUuid.h> +#include "cmSystemTools.h" +#include "cmUuid.h" #include "cm_sys_stat.h" diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.h b/Source/CPack/WiX/cmWIXFilesSourceWriter.h index d7a642d..dc9c636 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.h @@ -8,7 +8,7 @@ #include "cmWIXPatch.h" #include "cmWIXShortcut.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" /** \class cmWIXFilesSourceWriter * \brief Helper class to generate files.wxs diff --git a/Source/CPack/WiX/cmWIXPatch.cxx b/Source/CPack/WiX/cmWIXPatch.cxx index 7c48653..3a7dbfd 100644 --- a/Source/CPack/WiX/cmWIXPatch.cxx +++ b/Source/CPack/WiX/cmWIXPatch.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWIXPatch.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" cmWIXPatch::cmWIXPatch(cmCPackLog* logger) : Logger(logger) diff --git a/Source/CPack/WiX/cmWIXPatchParser.cxx b/Source/CPack/WiX/cmWIXPatchParser.cxx index 47f98d1..7f2ae19 100644 --- a/Source/CPack/WiX/cmWIXPatchParser.cxx +++ b/Source/CPack/WiX/cmWIXPatchParser.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWIXPatchParser.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" -#include <cm_expat.h> +#include "cm_expat.h" cmWIXPatchNode::Type cmWIXPatchText::type() { diff --git a/Source/CPack/WiX/cmWIXPatchParser.h b/Source/CPack/WiX/cmWIXPatchParser.h index a2f0a3c..c0c96cd 100644 --- a/Source/CPack/WiX/cmWIXPatchParser.h +++ b/Source/CPack/WiX/cmWIXPatchParser.h @@ -3,9 +3,9 @@ #ifndef cmCPackWIXPatchParser_h #define cmCPackWIXPatchParser_h -#include <CPack/cmCPackLog.h> +#include "cmCPackLog.h" -#include <cmXMLParser.h> +#include "cmXMLParser.h" #include <list> #include <map> diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx b/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx index d819347..2c99a22 100644 --- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx +++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWIXRichTextFormatWriter.h" -#include <cmVersion.h> +#include "cmVersion.h" cmWIXRichTextFormatWriter::cmWIXRichTextFormatWriter( std::string const& filename) diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h index a3c8394..30df878 100644 --- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h +++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h @@ -3,9 +3,9 @@ #ifndef cmWIXRichTextFormatWriter_h #define cmWIXRichTextFormatWriter_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <string> /** \class cmWIXRichtTextFormatWriter diff --git a/Source/CPack/WiX/cmWIXShortcut.h b/Source/CPack/WiX/cmWIXShortcut.h index cba3b34..23ddc6a 100644 --- a/Source/CPack/WiX/cmWIXShortcut.h +++ b/Source/CPack/WiX/cmWIXShortcut.h @@ -3,7 +3,7 @@ #ifndef cmWIXShortcut_h #define cmWIXShortcut_h -#include <cmInstalledFile.h> +#include "cmInstalledFile.h" #include <map> #include <set> diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index b434334..a86e28d 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWIXSourceWriter.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" -#include <cmUuid.h> +#include "cmUuid.h" #include <windows.h> diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h b/Source/CPack/WiX/cmWIXSourceWriter.h index 45aefe5..4af1ed6 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.h +++ b/Source/CPack/WiX/cmWIXSourceWriter.h @@ -3,9 +3,9 @@ #ifndef cmWIXSourceWriter_h #define cmWIXSourceWriter_h -#include <CPack/cmCPackLog.h> +#include "cmCPackLog.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <string> #include <vector> diff --git a/Source/CPack/cmCPack7zGenerator.h b/Source/CPack/cmCPack7zGenerator.h index a617d9b..42a4781 100644 --- a/Source/CPack/cmCPack7zGenerator.h +++ b/Source/CPack/cmCPack7zGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPack7zGenerator_h #define cmCPack7zGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index df02ae8..58d67e3 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackArchiveGenerator_h #define cmCPackArchiveGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmArchiveWrite.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackBundleGenerator.h b/Source/CPack/cmCPackBundleGenerator.h index c9200c1..861fe4b 100644 --- a/Source/CPack/cmCPackBundleGenerator.h +++ b/Source/CPack/cmCPackBundleGenerator.h @@ -3,7 +3,8 @@ #ifndef cmCPackBundleGenerator_h #define cmCPackBundleGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include "cmCPackDragNDropGenerator.h" diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h index 510adc2..26d69ba 100644 --- a/Source/CPack/cmCPackComponentGroup.h +++ b/Source/CPack/cmCPackComponentGroup.h @@ -3,7 +3,7 @@ #ifndef cmCPackComponentGroup_h #define cmCPackComponentGroup_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> #include <vector> diff --git a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx index e67811d..2119f78 100644 --- a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx +++ b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx @@ -9,7 +9,7 @@ #include "cmSystemTools.h" #include "cmake.h" -#include <cmsys/SystemTools.hxx> +#include "cmsys/SystemTools.hxx" cmCPackCygwinBinaryGenerator::cmCPackCygwinBinaryGenerator() { diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx index bd22cec..2c289f6 100644 --- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx +++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx @@ -9,7 +9,7 @@ #include "cmSystemTools.h" #include "cmake.h" -#include <cmsys/SystemTools.hxx> +#include "cmsys/SystemTools.hxx" // Includes needed for implementation of RenameFile. This is not in // system tools because it is not implemented robustly enough to move diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index ed87238..af54fce 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -10,7 +10,7 @@ #include "cmSystemTools.h" #include "cm_sys_stat.h" -#include <cmsys/Glob.hxx> +#include "cmsys/Glob.hxx" #include <limits.h> #include <map> #include <ostream> diff --git a/Source/CPack/cmCPackDebGenerator.h b/Source/CPack/cmCPackDebGenerator.h index 7db933e..e7cde11 100644 --- a/Source/CPack/cmCPackDebGenerator.h +++ b/Source/CPack/cmCPackDebGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackDebGenerator_h #define cmCPackDebGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index ec5fc88..9864cf3 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -7,8 +7,8 @@ #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/RegularExpression.hxx" #include <iomanip> #include <map> #include <stdlib.h> diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h index 876eab7..ae2cc17 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.h +++ b/Source/CPack/cmCPackDragNDropGenerator.h @@ -3,7 +3,8 @@ #ifndef cmCPackDragNDropGenerator_h #define cmCPackDragNDropGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <sstream> #include <stddef.h> #include <string> diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index f6ea8cf..a95ca76 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -2,10 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackGenerator.h" +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" +#include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/RegularExpression.hxx> #include <list> #include <utility> diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 39fd2cc..45777fa 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackGenerator_h #define cmCPackGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <map> #include <sstream> diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index b012f01..31f48c7 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackGeneratorFactory.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <ostream> #include <utility> diff --git a/Source/CPack/cmCPackGeneratorFactory.h b/Source/CPack/cmCPackGeneratorFactory.h index 4ee0bc1..7f633e4 100644 --- a/Source/CPack/cmCPackGeneratorFactory.h +++ b/Source/CPack/cmCPackGeneratorFactory.h @@ -3,7 +3,7 @@ #ifndef cmCPackGeneratorFactory_h #define cmCPackGeneratorFactory_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/CPack/cmCPackLog.cxx b/Source/CPack/cmCPackLog.cxx index 7d5c192..5c71239 100644 --- a/Source/CPack/cmCPackLog.cxx +++ b/Source/CPack/cmCPackLog.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackLog.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iostream> #include "cmGeneratedFileStream.h" diff --git a/Source/CPack/cmCPackLog.h b/Source/CPack/cmCPackLog.h index a988ccc..96c5882 100644 --- a/Source/CPack/cmCPackLog.h +++ b/Source/CPack/cmCPackLog.h @@ -3,7 +3,7 @@ #ifndef cmCPackLog_h #define cmCPackLog_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <ostream> #include <string.h> diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 1940953..beb2d01 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -8,9 +8,9 @@ #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" +#include "cmsys/Directory.hxx" +#include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <cmsys/Directory.hxx> -#include <cmsys/RegularExpression.hxx> #include <map> #include <sstream> #include <stdlib.h> diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h index b4bf2d4..77be325 100644 --- a/Source/CPack/cmCPackNSISGenerator.h +++ b/Source/CPack/cmCPackNSISGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackNSISGenerator_h #define cmCPackNSISGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackOSXX11Generator.h b/Source/CPack/cmCPackOSXX11Generator.h index 1918e21..0eebc6d 100644 --- a/Source/CPack/cmCPackOSXX11Generator.h +++ b/Source/CPack/cmCPackOSXX11Generator.h @@ -3,7 +3,8 @@ #ifndef cmCPackOSXX11Generator_h #define cmCPackOSXX11Generator_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackPKGGenerator.h b/Source/CPack/cmCPackPKGGenerator.h index 1e96a62..f873c59 100644 --- a/Source/CPack/cmCPackPKGGenerator.h +++ b/Source/CPack/cmCPackPKGGenerator.h @@ -3,7 +3,8 @@ #ifndef cmCPackPKGGenerator_h #define cmCPackPKGGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <set> #include <sstream> #include <string> diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 8000d6e..8db7cfb 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackPackageMakerGenerator.h" +#include "cmsys/FStream.hxx" +#include "cmsys/RegularExpression.hxx" #include <assert.h> -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> #include <map> #include <sstream> #include <stdio.h> diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h index d4c6744..6274515 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.h +++ b/Source/CPack/cmCPackPackageMakerGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackPackageMakerGenerator_h #define cmCPackPackageMakerGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackGenerator.h" #include "cmCPackPKGGenerator.h" diff --git a/Source/CPack/cmCPackProductBuildGenerator.h b/Source/CPack/cmCPackProductBuildGenerator.h index b6da470..12093a0 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.h +++ b/Source/CPack/cmCPackProductBuildGenerator.h @@ -3,7 +3,8 @@ #ifndef cmCPackProductBuildGenerator_h #define cmCPackProductBuildGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h index 4d48bd8..52cfc13 100644 --- a/Source/CPack/cmCPackRPMGenerator.h +++ b/Source/CPack/cmCPackRPMGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackRPMGenerator_h #define cmCPackRPMGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index 2765e2a..c541614 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackSTGZGenerator.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <sstream> #include <stdio.h> #include <string> diff --git a/Source/CPack/cmCPackSTGZGenerator.h b/Source/CPack/cmCPackSTGZGenerator.h index 4b9c1c6..8304e80 100644 --- a/Source/CPack/cmCPackSTGZGenerator.h +++ b/Source/CPack/cmCPackSTGZGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackSTGZGenerator_h #define cmCPackSTGZGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackGenerator.h" #include "cmCPackTGZGenerator.h" diff --git a/Source/CPack/cmCPackTGZGenerator.h b/Source/CPack/cmCPackTGZGenerator.h index ee2e975..9426b3a 100644 --- a/Source/CPack/cmCPackTGZGenerator.h +++ b/Source/CPack/cmCPackTGZGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackTGZGenerator_h #define cmCPackTGZGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackTXZGenerator.h b/Source/CPack/cmCPackTXZGenerator.h index 876ca7d..3b96e2d 100644 --- a/Source/CPack/cmCPackTXZGenerator.h +++ b/Source/CPack/cmCPackTXZGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackTXZGenerator_h #define cmCPackTXZGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackTarBZip2Generator.h b/Source/CPack/cmCPackTarBZip2Generator.h index 42214fd..9b4b8f4 100644 --- a/Source/CPack/cmCPackTarBZip2Generator.h +++ b/Source/CPack/cmCPackTarBZip2Generator.h @@ -3,7 +3,7 @@ #ifndef cmCPackTarBZip2Generator_h #define cmCPackTarBZip2Generator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackTarCompressGenerator.h b/Source/CPack/cmCPackTarCompressGenerator.h index 1476642..381d6eb 100644 --- a/Source/CPack/cmCPackTarCompressGenerator.h +++ b/Source/CPack/cmCPackTarCompressGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackTarCompressGenerator_h #define cmCPackTarCompressGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackZIPGenerator.h b/Source/CPack/cmCPackZIPGenerator.h index 95b6489..00c8720 100644 --- a/Source/CPack/cmCPackZIPGenerator.h +++ b/Source/CPack/cmCPackZIPGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackZIPGenerator_h #define cmCPackZIPGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index af80cbf..a48c8cd 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -1,9 +1,9 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cmsys/CommandLineArguments.hxx> -#include <cmsys/Encoding.hxx> +#include "cmsys/CommandLineArguments.hxx" +#include "cmsys/Encoding.hxx" #include <iostream> #include <map> #include <sstream> @@ -13,7 +13,7 @@ #include <vector> #if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) -#include <cmsys/ConsoleBuf.hxx> +#include "cmsys/ConsoleBuf.hxx" #endif #include "cmCPackGenerator.h" diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index 6769ee5..94f39c2 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -8,8 +8,8 @@ #include "cmSystemTools.h" #include "cmXMLParser.h" -#include <cm_expat.h> -#include <cmsys/RegularExpression.hxx> +#include "cm_expat.h" +#include "cmsys/RegularExpression.hxx" #include <list> #include <map> #include <ostream> diff --git a/Source/CTest/cmCTestBZR.h b/Source/CTest/cmCTestBZR.h index 0b62582..2e8e88f 100644 --- a/Source/CTest/cmCTestBZR.h +++ b/Source/CTest/cmCTestBZR.h @@ -3,7 +3,7 @@ #ifndef cmCTestBZR_h #define cmCTestBZR_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGlobalVC.h" diff --git a/Source/CTest/cmCTestBatchTestHandler.h b/Source/CTest/cmCTestBatchTestHandler.h index 44db252..4a5dac1 100644 --- a/Source/CTest/cmCTestBatchTestHandler.h +++ b/Source/CTest/cmCTestBatchTestHandler.h @@ -3,10 +3,10 @@ #ifndef cmCTestBatchTestHandler_h #define cmCTestBatchTestHandler_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cmCTestMultiProcessHandler.h> -#include <cmsys/FStream.hxx> +#include "cmCTestMultiProcessHandler.h" +#include "cmsys/FStream.hxx" #include <string> /** \class cmCTestBatchTestHandler diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 6f81429..ed7dd5d 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -9,7 +9,7 @@ #include "cmWorkingDirectory.h" #include "cmake.h" -#include <cmsys/Process.h> +#include "cmsys/Process.h" #include <stdlib.h> cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler() diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h index af082a3..2e85e9f 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.h +++ b/Source/CTest/cmCTestBuildAndTestHandler.h @@ -3,7 +3,7 @@ #ifndef cmCTestBuildAndTestHandler_h #define cmCTestBuildAndTestHandler_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGenericHandler.h" diff --git a/Source/CTest/cmCTestBuildCommand.h b/Source/CTest/cmCTestBuildCommand.h index 9cc6f7e..9cf6a96 100644 --- a/Source/CTest/cmCTestBuildCommand.h +++ b/Source/CTest/cmCTestBuildCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestBuildCommand_h #define cmCTestBuildCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestHandlerCommand.h" diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 1868a1e..b6075c9 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -11,9 +11,9 @@ #include "cmSystemTools.h" #include "cmXMLWriter.h" -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/Process.h> +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" +#include "cmsys/Process.h" #include <set> #include <stdlib.h> #include <string.h> diff --git a/Source/CTest/cmCTestBuildHandler.h b/Source/CTest/cmCTestBuildHandler.h index a2f6112..ef3cddf 100644 --- a/Source/CTest/cmCTestBuildHandler.h +++ b/Source/CTest/cmCTestBuildHandler.h @@ -3,12 +3,12 @@ #ifndef cmCTestBuildHandler_h #define cmCTestBuildHandler_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGenericHandler.h" -#include <cmProcessOutput.h> -#include <cmsys/RegularExpression.hxx> +#include "cmProcessOutput.h" +#include "cmsys/RegularExpression.hxx" #include <deque> #include <iosfwd> #include <stddef.h> diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx index 98bb678..fad360b 100644 --- a/Source/CTest/cmCTestCVS.cxx +++ b/Source/CTest/cmCTestCVS.cxx @@ -7,8 +7,8 @@ #include "cmSystemTools.h" #include "cmXMLWriter.h" -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/RegularExpression.hxx" #include <utility> cmCTestCVS::cmCTestCVS(cmCTest* ct, std::ostream& log) diff --git a/Source/CTest/cmCTestCVS.h b/Source/CTest/cmCTestCVS.h index d921b1a..1208cfa 100644 --- a/Source/CTest/cmCTestCVS.h +++ b/Source/CTest/cmCTestCVS.h @@ -3,7 +3,7 @@ #ifndef cmCTestCVS_h #define cmCTestCVS_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestVC.h" diff --git a/Source/CTest/cmCTestConfigureCommand.h b/Source/CTest/cmCTestConfigureCommand.h index 22d1217..917f5ab 100644 --- a/Source/CTest/cmCTestConfigureCommand.h +++ b/Source/CTest/cmCTestConfigureCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestConfigureCommand_h #define cmCTestConfigureCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestHandlerCommand.h" diff --git a/Source/CTest/cmCTestConfigureHandler.h b/Source/CTest/cmCTestConfigureHandler.h index 7fa95ed..2b45282 100644 --- a/Source/CTest/cmCTestConfigureHandler.h +++ b/Source/CTest/cmCTestConfigureHandler.h @@ -3,7 +3,7 @@ #ifndef cmCTestConfigureHandler_h #define cmCTestConfigureHandler_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGenericHandler.h" diff --git a/Source/CTest/cmCTestCoverageCommand.h b/Source/CTest/cmCTestCoverageCommand.h index bf42aa1..78c4f61 100644 --- a/Source/CTest/cmCTestCoverageCommand.h +++ b/Source/CTest/cmCTestCoverageCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestCoverageCommand_h #define cmCTestCoverageCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestHandlerCommand.h" diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 120c5d9..4d970d5 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -16,11 +16,11 @@ #include "cmXMLWriter.h" #include "cmake.h" +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" +#include "cmsys/Process.h" +#include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/Process.h> -#include <cmsys/RegularExpression.hxx> #include <iomanip> #include <iterator> #include <sstream> diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h index 339b5d7..933f606 100644 --- a/Source/CTest/cmCTestCoverageHandler.h +++ b/Source/CTest/cmCTestCoverageHandler.h @@ -3,11 +3,11 @@ #ifndef cmCTestCoverageHandler_h #define cmCTestCoverageHandler_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGenericHandler.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <iosfwd> #include <map> #include <set> diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index ab1412d..06b5e81 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -5,7 +5,7 @@ #include "cmCTest.h" #include "cmSystemTools.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <ostream> #include <stdio.h> diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h index cdce393..67608cb 100644 --- a/Source/CTest/cmCTestCurl.h +++ b/Source/CTest/cmCTestCurl.h @@ -3,9 +3,9 @@ #ifndef cmCTestCurl_h #define cmCTestCurl_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep -#include <cm_curl.h> +#include "cm_curl.h" #include <string> #include <vector> diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h index 4c1438b..bfd4061 100644 --- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h +++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestEmptyBinaryDirectoryCommand_h #define cmCTestEmptyBinaryDirectoryCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestCommand.h" diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 9c53aa1..17f822d 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestGIT.h" -#include <cmsys/FStream.hxx> -#include <cmsys/Process.h> +#include "cmsys/FStream.hxx" +#include "cmsys/Process.h" #include <ctype.h> #include <stdio.h> #include <stdlib.h> diff --git a/Source/CTest/cmCTestGIT.h b/Source/CTest/cmCTestGIT.h index d5a1ee3..4bf8294 100644 --- a/Source/CTest/cmCTestGIT.h +++ b/Source/CTest/cmCTestGIT.h @@ -3,7 +3,7 @@ #ifndef cmCTestGIT_h #define cmCTestGIT_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGlobalVC.h" diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 7638f45..19034c0 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestGenericHandler.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <sstream> #include <utility> diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h index 2ebbe70..e881252 100644 --- a/Source/CTest/cmCTestGenericHandler.h +++ b/Source/CTest/cmCTestGenericHandler.h @@ -3,7 +3,7 @@ #ifndef cmCTestGenericHandler_h #define cmCTestGenericHandler_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <stddef.h> diff --git a/Source/CTest/cmCTestGlobalVC.h b/Source/CTest/cmCTestGlobalVC.h index 9fa5f21..a5273d3 100644 --- a/Source/CTest/cmCTestGlobalVC.h +++ b/Source/CTest/cmCTestGlobalVC.h @@ -3,7 +3,7 @@ #ifndef cmCTestGlobalVC_h #define cmCTestGlobalVC_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestVC.h" diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx index 68ebd37..49f9a65 100644 --- a/Source/CTest/cmCTestHG.cxx +++ b/Source/CTest/cmCTestHG.cxx @@ -8,7 +8,7 @@ #include "cmSystemTools.h" #include "cmXMLParser.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <ostream> #include <vector> diff --git a/Source/CTest/cmCTestHG.h b/Source/CTest/cmCTestHG.h index 63baba2..ec9eaff 100644 --- a/Source/CTest/cmCTestHG.h +++ b/Source/CTest/cmCTestHG.h @@ -3,7 +3,7 @@ #ifndef cmCTestHG_h #define cmCTestHG_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGlobalVC.h" diff --git a/Source/CTest/cmCTestHandlerCommand.h b/Source/CTest/cmCTestHandlerCommand.h index c86841f..adc1687 100644 --- a/Source/CTest/cmCTestHandlerCommand.h +++ b/Source/CTest/cmCTestHandlerCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestHandlerCommand_h #define cmCTestHandlerCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestCommand.h" diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 03e0319..7195bb3 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -2,11 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestLaunch.h" -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cmsys/FStream.hxx> -#include <cmsys/Process.h> -#include <cmsys/RegularExpression.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/Process.h" +#include "cmsys/RegularExpression.hxx" #include <iostream> #include <stdlib.h> #include <string.h> diff --git a/Source/CTest/cmCTestLaunch.h b/Source/CTest/cmCTestLaunch.h index fbc9e2b..29986ff 100644 --- a/Source/CTest/cmCTestLaunch.h +++ b/Source/CTest/cmCTestLaunch.h @@ -3,9 +3,9 @@ #ifndef cmCTestLaunch_h #define cmCTestLaunch_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <set> #include <string> #include <vector> diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h index 458ebb0..fea65e8 100644 --- a/Source/CTest/cmCTestMemCheckCommand.h +++ b/Source/CTest/cmCTestMemCheckCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestMemCheckCommand_h #define cmCTestMemCheckCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestTestCommand.h" diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 620e237..fc4980b 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -7,9 +7,9 @@ #include "cmXMLParser.h" #include "cmXMLWriter.h" -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/RegularExpression.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" +#include "cmsys/RegularExpression.hxx" #include <iostream> #include <sstream> #include <string.h> diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h index ff8b593..333c2e2 100644 --- a/Source/CTest/cmCTestMemCheckHandler.h +++ b/Source/CTest/cmCTestMemCheckHandler.h @@ -3,7 +3,7 @@ #ifndef cmCTestMemCheckHandler_h #define cmCTestMemCheckHandler_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestTestHandler.h" diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 2d4726c..d738a1b 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -9,10 +9,10 @@ #include "cmSystemTools.h" #include "cmWorkingDirectory.h" +#include "cmsys/FStream.hxx" +#include "cmsys/String.hxx" +#include "cmsys/SystemInformation.hxx" #include <algorithm> -#include <cmsys/FStream.hxx> -#include <cmsys/String.hxx> -#include <cmsys/SystemInformation.hxx> #include <iomanip> #include <list> #include <math.h> diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index fe32e15..dccc2c8 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -3,9 +3,9 @@ #ifndef cmCTestMultiProcessHandler_h #define cmCTestMultiProcessHandler_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep -#include <cmCTestTestHandler.h> +#include "cmCTestTestHandler.h" #include <map> #include <set> #include <stddef.h> diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index 4f78876..c802216 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -7,8 +7,8 @@ #include "cmProcessTools.h" #include "cmSystemTools.h" +#include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <cmsys/RegularExpression.hxx> #include <ostream> #include <time.h> #include <utility> diff --git a/Source/CTest/cmCTestP4.h b/Source/CTest/cmCTestP4.h index 2c04dc6..e234efb 100644 --- a/Source/CTest/cmCTestP4.h +++ b/Source/CTest/cmCTestP4.h @@ -3,7 +3,7 @@ #ifndef cmCTestP4_h #define cmCTestP4_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGlobalVC.h" diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h index e155595..04024ab 100644 --- a/Source/CTest/cmCTestReadCustomFilesCommand.h +++ b/Source/CTest/cmCTestReadCustomFilesCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestReadCustomFilesCommand_h #define cmCTestReadCustomFilesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestCommand.h" diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h index 01ed62e..aac5114 100644 --- a/Source/CTest/cmCTestRunScriptCommand.h +++ b/Source/CTest/cmCTestRunScriptCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestRunScriptCommand_h #define cmCTestRunScriptCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestCommand.h" diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 94aa4bd..a4853b7 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -9,12 +9,12 @@ #include "cmSystemTools.h" #include "cmWorkingDirectory.h" -#include <cmConfigure.h> -#include <cm_curl.h> -#include <cm_zlib.h> -#include <cmsys/Base64.h> -#include <cmsys/Process.h> -#include <cmsys/RegularExpression.hxx> +#include "cmConfigure.h" +#include "cm_curl.h" +#include "cm_zlib.h" +#include "cmsys/Base64.h" +#include "cmsys/Process.h" +#include "cmsys/RegularExpression.hxx" #include <iomanip> #include <sstream> #include <stdio.h> diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index ee4630a..d3bb229 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -3,7 +3,7 @@ #ifndef cmCTestRunTest_h #define cmCTestRunTest_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <set> #include <stddef.h> diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx index ce395cd..0b87281 100644 --- a/Source/CTest/cmCTestSVN.cxx +++ b/Source/CTest/cmCTestSVN.cxx @@ -9,7 +9,7 @@ #include "cmXMLParser.h" #include "cmXMLWriter.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <map> #include <ostream> #include <stdlib.h> diff --git a/Source/CTest/cmCTestSVN.h b/Source/CTest/cmCTestSVN.h index e5fe5b7..d90d387 100644 --- a/Source/CTest/cmCTestSVN.h +++ b/Source/CTest/cmCTestSVN.h @@ -3,7 +3,7 @@ #ifndef cmCTestSVN_h #define cmCTestSVN_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGlobalVC.h" diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index b537242..60e48b6 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestScriptHandler.h" -#include <cmsys/Directory.hxx> -#include <cmsys/Process.h> +#include "cmsys/Directory.hxx" +#include "cmsys/Process.h" #include <map> #include <sstream> #include <stdio.h> diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index 47644be..3070796 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -3,7 +3,7 @@ #ifndef cmCTestScriptHandler_h #define cmCTestScriptHandler_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGenericHandler.h" diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h index 1052f76..a55e9d9 100644 --- a/Source/CTest/cmCTestSleepCommand.h +++ b/Source/CTest/cmCTestSleepCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestSleepCommand_h #define cmCTestSleepCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestCommand.h" diff --git a/Source/CTest/cmCTestStartCommand.h b/Source/CTest/cmCTestStartCommand.h index cc72d0c..26a63fb 100644 --- a/Source/CTest/cmCTestStartCommand.h +++ b/Source/CTest/cmCTestStartCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestStartCommand_h #define cmCTestStartCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestCommand.h" diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index f5b52c1..e566abb 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestSubmitCommand_h #define cmCTestSubmitCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTest.h" #include "cmCTestHandlerCommand.h" diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 88193b0..96d1491 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -2,10 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestSubmitHandler.h" -#include <cm_curl.h> -#include <cm_jsoncpp_reader.h> -#include <cm_jsoncpp_value.h> -#include <cmsys/Process.h> +#include "cm_curl.h" +#include "cm_jsoncpp_reader.h" +#include "cm_jsoncpp_value.h" +#include "cmsys/Process.h" #include <sstream> #include <stdio.h> #include <stdlib.h> @@ -26,7 +26,7 @@ #if defined(CTEST_USE_XMLRPC) #include "cmVersion.h" #include "cm_sys_stat.h" -#include <cm_xmlrpc.h> +#include "cm_xmlrpc.h" #endif #define SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT 120 diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index baaf8af..cf36546 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -3,7 +3,7 @@ #ifndef cmCTestSubmitHandler_h #define cmCTestSubmitHandler_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTest.h" #include "cmCTestGenericHandler.h" diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h index 3250d93..1893104 100644 --- a/Source/CTest/cmCTestTestCommand.h +++ b/Source/CTest/cmCTestTestCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestTestCommand_h #define cmCTestTestCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestHandlerCommand.h" diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 814b310..dafeec2 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2,11 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestTestHandler.h" +#include "cmsys/Base64.h" +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" +#include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <cmsys/Base64.h> -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> #include <functional> #include <iomanip> #include <iterator> diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index a95f088..3700f8a 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -3,11 +3,11 @@ #ifndef cmCTestTestHandler_h #define cmCTestTestHandler_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGenericHandler.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <iosfwd> #include <map> #include <set> diff --git a/Source/CTest/cmCTestUpdateCommand.h b/Source/CTest/cmCTestUpdateCommand.h index 5761f50..3b8f0a6 100644 --- a/Source/CTest/cmCTestUpdateCommand.h +++ b/Source/CTest/cmCTestUpdateCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestUpdateCommand_h #define cmCTestUpdateCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestHandlerCommand.h" diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 2b5683a..e08a9b7 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -16,7 +16,7 @@ #include "cmVersion.h" #include "cmXMLWriter.h" -#include <cm_auto_ptr.hxx> +#include "cm_auto_ptr.hxx" #include <sstream> static const char* cmCTestUpdateHandlerUpdateStrings[] = { diff --git a/Source/CTest/cmCTestUpdateHandler.h b/Source/CTest/cmCTestUpdateHandler.h index 87781e8..0cd2844 100644 --- a/Source/CTest/cmCTestUpdateHandler.h +++ b/Source/CTest/cmCTestUpdateHandler.h @@ -3,7 +3,7 @@ #ifndef cmCTestUpdateHandler_h #define cmCTestUpdateHandler_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTestGenericHandler.h" diff --git a/Source/CTest/cmCTestUploadCommand.h b/Source/CTest/cmCTestUploadCommand.h index 474f699..6e72179 100644 --- a/Source/CTest/cmCTestUploadCommand.h +++ b/Source/CTest/cmCTestUploadCommand.h @@ -3,7 +3,7 @@ #ifndef cmCTestUploadCommand_h #define cmCTestUploadCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTest.h" #include "cmCTestHandlerCommand.h" diff --git a/Source/CTest/cmCTestUploadHandler.h b/Source/CTest/cmCTestUploadHandler.h index 77c2aec..1e8d3c8 100644 --- a/Source/CTest/cmCTestUploadHandler.h +++ b/Source/CTest/cmCTestUploadHandler.h @@ -3,7 +3,7 @@ #ifndef cmCTestUploadHandler_h #define cmCTestUploadHandler_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTest.h" #include "cmCTestGenericHandler.h" diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index 26c9bb5..fb2742e 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -6,7 +6,7 @@ #include "cmSystemTools.h" #include "cmXMLWriter.h" -#include <cmsys/Process.h> +#include "cmsys/Process.h" #include <sstream> #include <stdio.h> #include <time.h> diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h index a1c1673..6400bcd 100644 --- a/Source/CTest/cmCTestVC.h +++ b/Source/CTest/cmCTestVC.h @@ -3,7 +3,7 @@ #ifndef cmCTestVC_h #define cmCTestVC_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <string> diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx index 6fa982e..54bb422 100644 --- a/Source/CTest/cmParseBlanketJSCoverage.cxx +++ b/Source/CTest/cmParseBlanketJSCoverage.cxx @@ -6,7 +6,7 @@ #include "cmCTestCoverageHandler.h" #include "cmSystemTools.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <stdio.h> #include <stdlib.h> diff --git a/Source/CTest/cmParseBlanketJSCoverage.h b/Source/CTest/cmParseBlanketJSCoverage.h index 660590d..696121f 100644 --- a/Source/CTest/cmParseBlanketJSCoverage.h +++ b/Source/CTest/cmParseBlanketJSCoverage.h @@ -3,7 +3,7 @@ #ifndef cmParseBlanketJSCoverage_h #define cmParseBlanketJSCoverage_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx index 23176b5..629010c 100644 --- a/Source/CTest/cmParseCacheCoverage.cxx +++ b/Source/CTest/cmParseCacheCoverage.cxx @@ -4,8 +4,8 @@ #include "cmCTestCoverageHandler.h" #include "cmSystemTools.h" -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" #include <map> #include <stdio.h> #include <stdlib.h> diff --git a/Source/CTest/cmParseCacheCoverage.h b/Source/CTest/cmParseCacheCoverage.h index 645d710..005d272 100644 --- a/Source/CTest/cmParseCacheCoverage.h +++ b/Source/CTest/cmParseCacheCoverage.h @@ -3,7 +3,7 @@ #ifndef cmParseCacheCoverage_h #define cmParseCacheCoverage_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmParseMumpsCoverage.h" diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx index db17748..ba55cd7 100644 --- a/Source/CTest/cmParseCoberturaCoverage.cxx +++ b/Source/CTest/cmParseCoberturaCoverage.cxx @@ -5,8 +5,8 @@ #include "cmSystemTools.h" #include "cmXMLParser.h" -#include <cmConfigure.h> -#include <cmsys/FStream.hxx> +#include "cmConfigure.h" +#include "cmsys/FStream.hxx" #include <stdlib.h> #include <string.h> diff --git a/Source/CTest/cmParseCoberturaCoverage.h b/Source/CTest/cmParseCoberturaCoverage.h index 077eb80..cb6d097 100644 --- a/Source/CTest/cmParseCoberturaCoverage.h +++ b/Source/CTest/cmParseCoberturaCoverage.h @@ -3,7 +3,7 @@ #ifndef cmParseCoberturaCoverage_h #define cmParseCoberturaCoverage_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx index 7fe91f4..9ae48d8 100644 --- a/Source/CTest/cmParseDelphiCoverage.cxx +++ b/Source/CTest/cmParseDelphiCoverage.cxx @@ -4,8 +4,8 @@ #include "cmCTestCoverageHandler.h" #include "cmSystemTools.h" -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" #include <stdio.h> #include <stdlib.h> diff --git a/Source/CTest/cmParseDelphiCoverage.h b/Source/CTest/cmParseDelphiCoverage.h index 278fbeb..1b37405 100644 --- a/Source/CTest/cmParseDelphiCoverage.h +++ b/Source/CTest/cmParseDelphiCoverage.h @@ -3,7 +3,7 @@ #ifndef cmParseDelphiCoverage_h #define cmParseDelphiCoverage_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index 214ce5a..15ef059 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -4,8 +4,8 @@ #include "cmCTestCoverageHandler.h" #include "cmSystemTools.h" -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" #include <map> #include <stdio.h> #include <stdlib.h> diff --git a/Source/CTest/cmParseGTMCoverage.h b/Source/CTest/cmParseGTMCoverage.h index 34721ff..c4949d4 100644 --- a/Source/CTest/cmParseGTMCoverage.h +++ b/Source/CTest/cmParseGTMCoverage.h @@ -3,7 +3,7 @@ #ifndef cmParseGTMCoverage_h #define cmParseGTMCoverage_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmParseMumpsCoverage.h" diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx index 0e36c01..d15864a 100644 --- a/Source/CTest/cmParseJacocoCoverage.cxx +++ b/Source/CTest/cmParseJacocoCoverage.cxx @@ -1,15 +1,15 @@ #include "cmParseJacocoCoverage.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCTest.h" #include "cmCTestCoverageHandler.h" #include "cmSystemTools.h" #include "cmXMLParser.h" -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" #include <stdlib.h> #include <string.h> diff --git a/Source/CTest/cmParseJacocoCoverage.h b/Source/CTest/cmParseJacocoCoverage.h index 04f1949..f2aec6d 100644 --- a/Source/CTest/cmParseJacocoCoverage.h +++ b/Source/CTest/cmParseJacocoCoverage.h @@ -3,7 +3,7 @@ #ifndef cmParseJacocoCoverage_h #define cmParseJacocoCoverage_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx index ab8be76..eb29f55 100644 --- a/Source/CTest/cmParseMumpsCoverage.cxx +++ b/Source/CTest/cmParseMumpsCoverage.cxx @@ -4,9 +4,9 @@ #include "cmCTestCoverageHandler.h" #include "cmSystemTools.h" -#include <cmConfigure.h> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> +#include "cmConfigure.h" +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" #include <map> #include <string> #include <utility> diff --git a/Source/CTest/cmParseMumpsCoverage.h b/Source/CTest/cmParseMumpsCoverage.h index c4ed175..2c54495 100644 --- a/Source/CTest/cmParseMumpsCoverage.h +++ b/Source/CTest/cmParseMumpsCoverage.h @@ -3,7 +3,7 @@ #ifndef cmParseMumpsCoverage_h #define cmParseMumpsCoverage_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx index d8bb31b..761ebec 100644 --- a/Source/CTest/cmParsePHPCoverage.cxx +++ b/Source/CTest/cmParsePHPCoverage.cxx @@ -4,8 +4,8 @@ #include "cmCTestCoverageHandler.h" #include "cmSystemTools.h" -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" #include <stdlib.h> #include <string.h> diff --git a/Source/CTest/cmParsePHPCoverage.h b/Source/CTest/cmParsePHPCoverage.h index 4bcad6d..ff0e636 100644 --- a/Source/CTest/cmParsePHPCoverage.h +++ b/Source/CTest/cmParsePHPCoverage.h @@ -3,7 +3,7 @@ #ifndef cmParsePHPCoverage_h #define cmParsePHPCoverage_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> #include <string> diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 32ffa6b..f4ec6da 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmProcess.h" -#include <cmConfigure.h> -#include <cmProcessOutput.h> -#include <cmSystemTools.h> +#include "cmConfigure.h" +#include "cmProcessOutput.h" +#include "cmSystemTools.h" #include <iostream> cmProcess::cmProcess() diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h index 9d201d1..86e905a 100644 --- a/Source/CTest/cmProcess.h +++ b/Source/CTest/cmProcess.h @@ -3,9 +3,9 @@ #ifndef cmProcess_h #define cmProcess_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep -#include <cmsys/Process.h> +#include "cmsys/Process.h" #include <string> #include <vector> diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index ff8e010..1698a84 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -1,6 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCursesForm.h" #include "cmCursesMainForm.h" @@ -10,7 +10,7 @@ #include "cmSystemTools.h" #include "cmake.h" -#include <cmsys/Encoding.hxx> +#include "cmsys/Encoding.hxx" #include <iostream> #include <signal.h> #include <string.h> diff --git a/Source/CursesDialog/cmCursesBoolWidget.h b/Source/CursesDialog/cmCursesBoolWidget.h index f79f7e8..45f01aa 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.h +++ b/Source/CursesDialog/cmCursesBoolWidget.h @@ -3,7 +3,7 @@ #ifndef cmCursesBoolWidget_h #define cmCursesBoolWidget_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCursesStandardIncludes.h" #include "cmCursesWidget.h" diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 5539fbe..cdde1a3 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -14,8 +14,8 @@ #include "cmSystemTools.h" #include "cmake.h" +#include "cmConfigure.h" #include <assert.h> -#include <cmConfigure.h> #include <vector> cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index 59a1fd7..1dbcfa4 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -3,7 +3,7 @@ #ifndef cmCursesCacheEntryComposite_h #define cmCursesCacheEntryComposite_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/CursesDialog/cmCursesDummyWidget.h b/Source/CursesDialog/cmCursesDummyWidget.h index fe43de5..0381f25 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.h +++ b/Source/CursesDialog/cmCursesDummyWidget.h @@ -3,7 +3,7 @@ #ifndef cmCursesDummyWidget_h #define cmCursesDummyWidget_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCursesStandardIncludes.h" #include "cmCursesWidget.h" diff --git a/Source/CursesDialog/cmCursesFilePathWidget.h b/Source/CursesDialog/cmCursesFilePathWidget.h index 7df7f00..b4c04cb 100644 --- a/Source/CursesDialog/cmCursesFilePathWidget.h +++ b/Source/CursesDialog/cmCursesFilePathWidget.h @@ -3,7 +3,7 @@ #ifndef cmCursesFilePathWidget_h #define cmCursesFilePathWidget_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmCursesPathWidget.h" diff --git a/Source/CursesDialog/cmCursesForm.cxx b/Source/CursesDialog/cmCursesForm.cxx index 0eb16cb..12e5d75 100644 --- a/Source/CursesDialog/cmCursesForm.cxx +++ b/Source/CursesDialog/cmCursesForm.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCursesForm.h" -#include <cmConfigure.h> +#include "cmConfigure.h" cmsys::ofstream cmCursesForm::DebugFile; bool cmCursesForm::Debug = false; diff --git a/Source/CursesDialog/cmCursesForm.h b/Source/CursesDialog/cmCursesForm.h index 85a80c2..7eb94a8 100644 --- a/Source/CursesDialog/cmCursesForm.h +++ b/Source/CursesDialog/cmCursesForm.h @@ -3,11 +3,11 @@ #ifndef cmCursesForm_h #define cmCursesForm_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmCursesStandardIncludes.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" class cmCursesForm { diff --git a/Source/CursesDialog/cmCursesLabelWidget.h b/Source/CursesDialog/cmCursesLabelWidget.h index 4d63f48..a0de4c6 100644 --- a/Source/CursesDialog/cmCursesLabelWidget.h +++ b/Source/CursesDialog/cmCursesLabelWidget.h @@ -3,7 +3,7 @@ #ifndef cmCursesLabelWidget_h #define cmCursesLabelWidget_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCursesStandardIncludes.h" #include "cmCursesWidget.h" diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h index e9eae7c..ab49c07 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.h +++ b/Source/CursesDialog/cmCursesLongMessageForm.h @@ -3,7 +3,7 @@ #ifndef cmCursesLongMessageForm_h #define cmCursesLongMessageForm_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCursesForm.h" #include "cmCursesStandardIncludes.h" diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index d891ea0..b91211e 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -3,7 +3,7 @@ #ifndef cmCursesMainForm_h #define cmCursesMainForm_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCursesForm.h" #include "cmCursesStandardIncludes.h" diff --git a/Source/CursesDialog/cmCursesOptionsWidget.h b/Source/CursesDialog/cmCursesOptionsWidget.h index 75065a2..4b2e8b4 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.h +++ b/Source/CursesDialog/cmCursesOptionsWidget.h @@ -3,7 +3,7 @@ #ifndef cmCursesOptionsWidget_h #define cmCursesOptionsWidget_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCursesStandardIncludes.h" #include "cmCursesWidget.h" diff --git a/Source/CursesDialog/cmCursesPathWidget.h b/Source/CursesDialog/cmCursesPathWidget.h index 63ed05b..097eeca 100644 --- a/Source/CursesDialog/cmCursesPathWidget.h +++ b/Source/CursesDialog/cmCursesPathWidget.h @@ -3,7 +3,7 @@ #ifndef cmCursesPathWidget_h #define cmCursesPathWidget_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCursesStandardIncludes.h" #include "cmCursesStringWidget.h" diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h index 7818e3e..5c59504 100644 --- a/Source/CursesDialog/cmCursesStandardIncludes.h +++ b/Source/CursesDialog/cmCursesStandardIncludes.h @@ -3,7 +3,7 @@ #ifndef cmCursesStandardIncludes_h #define cmCursesStandardIncludes_h -#include <cmConfigure.h> +#include "cmConfigure.h" #if defined(__hpux) #define _BOOL_DEFINED diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h index b3c1089..c07bfce 100644 --- a/Source/CursesDialog/cmCursesStringWidget.h +++ b/Source/CursesDialog/cmCursesStringWidget.h @@ -3,7 +3,7 @@ #ifndef cmCursesStringWidget_h #define cmCursesStringWidget_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCursesStandardIncludes.h" #include "cmCursesWidget.h" diff --git a/Source/CursesDialog/cmCursesWidget.cxx b/Source/CursesDialog/cmCursesWidget.cxx index a9918f7..229a050 100644 --- a/Source/CursesDialog/cmCursesWidget.cxx +++ b/Source/CursesDialog/cmCursesWidget.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCursesWidget.h" -#include <cmConfigure.h> +#include "cmConfigure.h" cmCursesWidget::cmCursesWidget(int width, int height, int left, int top) { diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h index d226dd7..5ce8a75 100644 --- a/Source/CursesDialog/cmCursesWidget.h +++ b/Source/CursesDialog/cmCursesWidget.h @@ -3,7 +3,7 @@ #ifndef cmCursesWidget_h #define cmCursesWidget_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmCursesStandardIncludes.h" #include "cmStateTypes.h" diff --git a/Source/CursesDialog/form/form.h b/Source/CursesDialog/form/form.h index b65a3ca..39ed75a 100644 --- a/Source/CursesDialog/form/form.h +++ b/Source/CursesDialog/form/form.h @@ -33,7 +33,7 @@ #ifndef FORM_H #define FORM_H -#include <cmFormConfigure.h> +#include "cmFormConfigure.h" /* figure out which curses.h to include */ # if defined(CURSES_HAVE_NCURSES_H) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 10fd718..2e11a8a 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -198,7 +198,7 @@ if(UNIX AND NOT APPLE) # install a desktop file so CMake appears in the application start menu # with an icon - install(FILES CMake.desktop + install(FILES cmake-gui.desktop DESTINATION "${CMAKE_XDGDATA_DIR}/applications" ${COMPONENT}) install(FILES cmakecache.xml diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index b2f0b2d..b955d77 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -8,6 +8,9 @@ #include "cmDocumentationEntry.h" #include "cmVersion.h" #include "cmake.h" +#include "cmsys/CommandLineArguments.hxx" +#include "cmsys/Encoding.hxx" +#include "cmsys/SystemTools.hxx" #include <QApplication> #include <QDir> #include <QLocale> @@ -15,9 +18,6 @@ #include <QTextCodec> #include <QTranslator> #include <QtPlugin> -#include <cmsys/CommandLineArguments.hxx> -#include <cmsys/Encoding.hxx> -#include <cmsys/SystemTools.hxx> #include <iostream> #include "cmSystemTools.h" // IWYU pragma: keep diff --git a/Source/QtDialog/Compilers.h b/Source/QtDialog/Compilers.h index 276e2a5..6c8c8f5 100644 --- a/Source/QtDialog/Compilers.h +++ b/Source/QtDialog/Compilers.h @@ -3,7 +3,7 @@ #ifndef COMPILERS_HPP #define COMPILERS_HPP -#include <cmConfigure.h> +#include "cmConfigure.h" #include <QWidget> diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index 12f6037..e14cdf2 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -3,7 +3,7 @@ #ifndef QCMake_h #define QCMake_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmake.h" diff --git a/Source/QtDialog/QCMakeWidgets.h b/Source/QtDialog/QCMakeWidgets.h index 0db810c..1ec666f 100644 --- a/Source/QtDialog/QCMakeWidgets.h +++ b/Source/QtDialog/QCMakeWidgets.h @@ -3,7 +3,7 @@ #ifndef QCMakeWidgets_h #define QCMakeWidgets_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <QComboBox> #include <QCompleter> diff --git a/Source/QtDialog/RegexExplorer.h b/Source/QtDialog/RegexExplorer.h index caef975..8679892 100644 --- a/Source/QtDialog/RegexExplorer.h +++ b/Source/QtDialog/RegexExplorer.h @@ -3,8 +3,8 @@ #ifndef RegexExplorer_h #define RegexExplorer_h +#include "cmsys/RegularExpression.hxx" #include <QDialog> -#include <cmsys/RegularExpression.hxx> #include <string> #include "ui_RegexExplorer.h" diff --git a/Source/QtDialog/CMake.desktop b/Source/QtDialog/cmake-gui.desktop index 842091f..842091f 100644 --- a/Source/QtDialog/CMake.desktop +++ b/Source/QtDialog/cmake-gui.desktop diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx index 75a2177..6026a57 100644 --- a/Source/bindexplib.cxx +++ b/Source/bindexplib.cxx @@ -63,8 +63,8 @@ */ #include "bindexplib.h" -#include <cmsys/Encoding.hxx> -#include <cmsys/FStream.hxx> +#include "cmsys/Encoding.hxx" +#include "cmsys/FStream.hxx" #include <iostream> #include <windows.h> diff --git a/Source/bindexplib.h b/Source/bindexplib.h index 51fe49d..bc904e9 100644 --- a/Source/bindexplib.h +++ b/Source/bindexplib.h @@ -3,7 +3,7 @@ #ifndef bindexplib_h #define bindexplib_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <set> #include <stdio.h> diff --git a/Source/cmAddCompileOptionsCommand.h b/Source/cmAddCompileOptionsCommand.h index 71009b4..105d323 100644 --- a/Source/cmAddCompileOptionsCommand.h +++ b/Source/cmAddCompileOptionsCommand.h @@ -3,7 +3,8 @@ #ifndef cmAddCompileOptionsCommand_h #define cmAddCompileOptionsCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h index ea92163..912a91a 100644 --- a/Source/cmAddCustomCommandCommand.h +++ b/Source/cmAddCustomCommandCommand.h @@ -3,7 +3,8 @@ #ifndef cmAddCustomCommandCommand_h #define cmAddCustomCommandCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h index b679247..c449b10 100644 --- a/Source/cmAddCustomTargetCommand.h +++ b/Source/cmAddCustomTargetCommand.h @@ -3,7 +3,8 @@ #ifndef cmAddCustomTargetCommand_h #define cmAddCustomTargetCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmAddDefinitionsCommand.h b/Source/cmAddDefinitionsCommand.h index 735f8cc..de4bc1c 100644 --- a/Source/cmAddDefinitionsCommand.h +++ b/Source/cmAddDefinitionsCommand.h @@ -3,7 +3,8 @@ #ifndef cmAddDefinitionsCommand_h #define cmAddDefinitionsCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h index 8be546c..88ac336 100644 --- a/Source/cmAddDependenciesCommand.h +++ b/Source/cmAddDependenciesCommand.h @@ -3,7 +3,8 @@ #ifndef cmDependenciessCommand_h #define cmDependenciessCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmAddExecutableCommand.h b/Source/cmAddExecutableCommand.h index 62583d8..6531829 100644 --- a/Source/cmAddExecutableCommand.h +++ b/Source/cmAddExecutableCommand.h @@ -3,7 +3,8 @@ #ifndef cmExecutablesCommand_h #define cmExecutablesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 9ae4ace..0bdf963 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -297,10 +297,15 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args, return false; } if (type == cmStateEnums::OBJECT_LIBRARY) { - this->Makefile->IssueMessage( - cmake::FATAL_ERROR, - "The OBJECT library type may not be used for IMPORTED libraries."); - return true; + std::string reason; + if (!this->Makefile->GetGlobalGenerator()->HasKnownObjectFileLocation( + &reason)) { + this->Makefile->IssueMessage( + cmake::FATAL_ERROR, + "The OBJECT library type may not be used for IMPORTED libraries" + + reason + "."); + return true; + } } if (type == cmStateEnums::INTERFACE_LIBRARY) { if (!cmGeneratorExpression::IsValidTargetName(libName)) { diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h index c23b299..977645e 100644 --- a/Source/cmAddLibraryCommand.h +++ b/Source/cmAddLibraryCommand.h @@ -3,7 +3,8 @@ #ifndef cmLibrarysCommand_h #define cmLibrarysCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h index 85305e6..b19477a 100644 --- a/Source/cmAddSubDirectoryCommand.h +++ b/Source/cmAddSubDirectoryCommand.h @@ -3,7 +3,8 @@ #ifndef cmAddSubDirectoryCommand_h #define cmAddSubDirectoryCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h index 07eff68..1d6c4cc 100644 --- a/Source/cmAddTestCommand.h +++ b/Source/cmAddTestCommand.h @@ -3,7 +3,8 @@ #ifndef cmAddTestCommand_h #define cmAddTestCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index f5469e5..70581ad 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -3,10 +3,10 @@ #ifndef cmAlgorithms_h #define cmAlgorithms_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep +#include "cm_kwiml.h" #include <algorithm> -#include <cm_kwiml.h> #include <functional> #include <iterator> #include <sstream> diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 879c2ca..0f13b11 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -5,10 +5,10 @@ #include "cmLocale.h" #include "cmSystemTools.h" #include "cm_get_date.h" -#include <cm_libarchive.h> -#include <cmsys/Directory.hxx> -#include <cmsys/Encoding.hxx> -#include <cmsys/FStream.hxx> +#include "cm_libarchive.h" +#include "cmsys/Directory.hxx" +#include "cmsys/Encoding.hxx" +#include "cmsys/FStream.hxx" #include <iostream> #include <string.h> #include <time.h> diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 27c62b9..4c85c0d 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -3,7 +3,7 @@ #ifndef cmArchiveWrite_h #define cmArchiveWrite_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> #include <stddef.h> diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index 7cfa4d8..c92c47b 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmAuxSourceDirectoryCommand.h" +#include "cmsys/Directory.hxx" #include <algorithm> -#include <cmsys/Directory.hxx> #include <stddef.h> #include "cmAlgorithms.h" diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h index d99bf7b..f8800a5 100644 --- a/Source/cmAuxSourceDirectoryCommand.h +++ b/Source/cmAuxSourceDirectoryCommand.h @@ -3,7 +3,8 @@ #ifndef cmAuxSourceDirectoryCommand_h #define cmAuxSourceDirectoryCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmBase32.h b/Source/cmBase32.h index 44bca2f..c6758d4 100644 --- a/Source/cmBase32.h +++ b/Source/cmBase32.h @@ -3,7 +3,7 @@ #ifndef cmBase32_h #define cmBase32_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <stddef.h> #include <string> diff --git a/Source/cmBreakCommand.h b/Source/cmBreakCommand.h index 5113e18..8ce5ca2 100644 --- a/Source/cmBreakCommand.h +++ b/Source/cmBreakCommand.h @@ -3,7 +3,8 @@ #ifndef cmBreakCommand_h #define cmBreakCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h index 62f1fd3..7df54ec 100644 --- a/Source/cmBuildCommand.h +++ b/Source/cmBuildCommand.h @@ -3,7 +3,8 @@ #ifndef cmBuildCommand_h #define cmBuildCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 93e5ca2..9d2c0c6 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmBuildNameCommand.h" +#include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <cmsys/RegularExpression.hxx> #include "cmMakefile.h" #include "cmStateTypes.h" diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h index 1e1f4b5..00f645a 100644 --- a/Source/cmBuildNameCommand.h +++ b/Source/cmBuildNameCommand.h @@ -3,7 +3,8 @@ #ifndef cmBuildNameCommand_h #define cmBuildNameCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h index 32cc8df..c4065e1 100644 --- a/Source/cmCLocaleEnvironmentScope.h +++ b/Source/cmCLocaleEnvironmentScope.h @@ -3,7 +3,7 @@ #ifndef cmCLocaleEnvironmentScope_h #define cmCLocaleEnvironmentScope_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/cmCMakeHostSystemInformationCommand.h b/Source/cmCMakeHostSystemInformationCommand.h index 22f3d54..fe148a3 100644 --- a/Source/cmCMakeHostSystemInformationCommand.h +++ b/Source/cmCMakeHostSystemInformationCommand.h @@ -3,7 +3,8 @@ #ifndef cmCMakeHostSystemInformationCommand_h #define cmCMakeHostSystemInformationCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <stddef.h> #include <string> #include <vector> diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h index 08a5c38..8db0860 100644 --- a/Source/cmCMakeMinimumRequired.h +++ b/Source/cmCMakeMinimumRequired.h @@ -3,7 +3,8 @@ #ifndef cmCMakeMinimumRequired_h #define cmCMakeMinimumRequired_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h index 409fc59..789e294 100644 --- a/Source/cmCMakePolicyCommand.h +++ b/Source/cmCMakePolicyCommand.h @@ -3,7 +3,8 @@ #ifndef cmCMakePolicyCommand_h #define cmCMakePolicyCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmCPackPropertiesGenerator.h b/Source/cmCPackPropertiesGenerator.h index 37c6039..6df5297 100644 --- a/Source/cmCPackPropertiesGenerator.h +++ b/Source/cmCPackPropertiesGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackPropertiesGenerator_h #define cmCPackPropertiesGenerator_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmScriptGenerator.h" diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index e6e50e9..46fa86e 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2,15 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTest.h" -#include <cm_curl.h> -#include <cm_zlib.h> -#include <cmsys/Base64.h> -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/Process.h> -#include <cmsys/String.hxx> -#include <cmsys/SystemInformation.hxx> +#include "cm_curl.h" +#include "cm_zlib.h" +#include "cmsys/Base64.h" +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" +#include "cmsys/Process.h" +#include "cmsys/String.hxx" +#include "cmsys/SystemInformation.hxx" #include <ctype.h> #include <iostream> #include <map> diff --git a/Source/cmCTest.h b/Source/cmCTest.h index be736da..60f3295 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -3,10 +3,10 @@ #ifndef cmCTest_h #define cmCTest_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cmProcessOutput.h> -#include <cmsys/String.hxx> +#include "cmProcessOutput.h" +#include "cmsys/String.hxx" #include <map> #include <set> #include <sstream> diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index cb0ba63..f7fefca 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCacheManager.h" +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" #include <algorithm> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> #include <sstream> #include <stdio.h> #include <string.h> diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index e82c9ef..a72d6cb 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -3,7 +3,7 @@ #ifndef cmCacheManager_h #define cmCacheManager_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> #include <map> diff --git a/Source/cmCallVisualStudioMacro.h b/Source/cmCallVisualStudioMacro.h index e9d34e5..ad35d30 100644 --- a/Source/cmCallVisualStudioMacro.h +++ b/Source/cmCallVisualStudioMacro.h @@ -3,7 +3,7 @@ #ifndef cmCallVisualStudioMacro_h #define cmCallVisualStudioMacro_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> diff --git a/Source/cmCommand.h b/Source/cmCommand.h index 9107d85..f4a75d5 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -3,7 +3,8 @@ #ifndef cmCommand_h #define cmCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmCommandArgumentParser.cxx b/Source/cmCommandArgumentParser.cxx index 4a7acfc..aed0826 100644 --- a/Source/cmCommandArgumentParser.cxx +++ b/Source/cmCommandArgumentParser.cxx @@ -85,7 +85,7 @@ Modify cmCommandArgumentParser.cxx: */ -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string.h> diff --git a/Source/cmCommandArgumentParser.y b/Source/cmCommandArgumentParser.y index d71b605..d6c8312 100644 --- a/Source/cmCommandArgumentParser.y +++ b/Source/cmCommandArgumentParser.y @@ -14,7 +14,7 @@ Modify cmCommandArgumentParser.cxx: */ -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string.h> diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 1222d5a..153efc4 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -8,7 +8,7 @@ #include "cmSystemTools.h" #include "cmake.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iostream> #include <sstream> #include <string.h> diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h index 5bfb236..2b65a5a 100644 --- a/Source/cmCommandArgumentParserHelper.h +++ b/Source/cmCommandArgumentParserHelper.h @@ -3,7 +3,7 @@ #ifndef cmCommandArgumentParserHelper_h #define cmCommandArgumentParserHelper_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h index b19b0f9..44db374 100644 --- a/Source/cmCommandArgumentsHelper.h +++ b/Source/cmCommandArgumentsHelper.h @@ -3,7 +3,7 @@ #ifndef cmCommandArgumentsHelper_h #define cmCommandArgumentsHelper_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <set> #include <string> diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index fe2c0fe..178a7ce 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCommonTargetGenerator.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <set> #include <sstream> #include <utility> diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h index 425ff91..8ba2e22 100644 --- a/Source/cmCommonTargetGenerator.h +++ b/Source/cmCommonTargetGenerator.h @@ -3,7 +3,8 @@ #ifndef cmCommonTargetGenerator_h #define cmCommonTargetGenerator_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep + #include <map> #include <string> #include <vector> diff --git a/Source/cmComputeComponentGraph.h b/Source/cmComputeComponentGraph.h index 608dedc..8cd4fe7 100644 --- a/Source/cmComputeComponentGraph.h +++ b/Source/cmComputeComponentGraph.h @@ -3,7 +3,7 @@ #ifndef cmComputeComponentGraph_h #define cmComputeComponentGraph_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmGraphAdjacencyList.h" diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index 6a4e8e0..195b544 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -3,7 +3,7 @@ #ifndef cmComputeLinkDepends_h #define cmComputeLinkDepends_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmGraphAdjacencyList.h" #include "cmLinkItem.h" diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 3d26ea7..60878e4 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -3,9 +3,9 @@ #ifndef cmComputeLinkInformation_h #define cmComputeLinkInformation_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <iosfwd> #include <set> #include <string> diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h index 2b6591f..ccf99de 100644 --- a/Source/cmComputeTargetDepends.h +++ b/Source/cmComputeTargetDepends.h @@ -3,7 +3,7 @@ #ifndef cmComputeTargetDepends_h #define cmComputeTargetDepends_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmGraphAdjacencyList.h" diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index f2eb601..bcfbfbe 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmConditionEvaluator.h" +#include "cmConfigure.h" +#include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <cmConfigure.h> -#include <cmsys/RegularExpression.hxx> #include <sstream> #include <stdio.h> #include <stdlib.h> diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index 5815177..50f4edc 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -3,7 +3,7 @@ #ifndef cmConditionEvaluator_h #define cmConditionEvaluator_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <list> #include <string> diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index 5f89ba1..e30b43f 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -3,7 +3,7 @@ #ifndef cmConfigure_h #define cmConfigure_h -#include <cmsys/Configure.hxx> // IWYU pragma: export +#include "cmsys/Configure.hxx" // IWYU pragma: export #ifdef _MSC_VER #pragma warning(disable : 4786) diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h index e558b85..882219d 100644 --- a/Source/cmConfigureFileCommand.h +++ b/Source/cmConfigureFileCommand.h @@ -3,7 +3,8 @@ #ifndef cmConfigureFileCommand_h #define cmConfigureFileCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmContinueCommand.h b/Source/cmContinueCommand.h index c5b8919..4428d79 100644 --- a/Source/cmContinueCommand.h +++ b/Source/cmContinueCommand.h @@ -3,7 +3,8 @@ #ifndef cmContinueCommand_h #define cmContinueCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index fd9d04b..2287bc2 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCoreTryCompile.h" -#include <cmConfigure.h> -#include <cmsys/Directory.hxx> +#include "cmConfigure.h" +#include "cmsys/Directory.hxx" #include <set> #include <sstream> #include <stdio.h> diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h index 4b96aed..365154d 100644 --- a/Source/cmCoreTryCompile.h +++ b/Source/cmCoreTryCompile.h @@ -3,7 +3,7 @@ #ifndef cmCoreTryCompile_h #define cmCoreTryCompile_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h index 5e003cf..47391f3 100644 --- a/Source/cmCreateTestSourceList.h +++ b/Source/cmCreateTestSourceList.h @@ -3,7 +3,7 @@ #ifndef cmCreateTestSourceList_h #define cmCreateTestSourceList_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> #include <vector> diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx index d5807b1..7995b2c 100644 --- a/Source/cmCryptoHash.cxx +++ b/Source/cmCryptoHash.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCryptoHash.h" -#include <cm_kwiml.h> -#include <cm_rhash.h> -#include <cmsys/FStream.hxx> +#include "cm_kwiml.h" +#include "cm_rhash.h" +#include "cmsys/FStream.hxx" #include <string.h> static unsigned int const cmCryptoHashAlgoToId[] = { diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h index 0b562da..021ad10 100644 --- a/Source/cmCryptoHash.h +++ b/Source/cmCryptoHash.h @@ -3,7 +3,7 @@ #ifndef cmCryptoHash_h #define cmCryptoHash_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <stddef.h> #include <string> diff --git a/Source/cmCurl.h b/Source/cmCurl.h index 60ab9fe..a2fa4b1 100644 --- a/Source/cmCurl.h +++ b/Source/cmCurl.h @@ -3,9 +3,9 @@ #ifndef cmCurl_h #define cmCurl_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cm_curl.h> +#include "cm_curl.h" #include <string> std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = CM_NULLPTR); diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx index 050de17..5e377b5 100644 --- a/Source/cmCustomCommand.cxx +++ b/Source/cmCustomCommand.cxx @@ -4,7 +4,7 @@ #include "cmMakefile.h" -#include <cmConfigure.h> +#include "cmConfigure.h" cmCustomCommand::cmCustomCommand() : Backtrace() diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h index 73d53ff..9e82f25 100644 --- a/Source/cmCustomCommand.h +++ b/Source/cmCustomCommand.h @@ -3,7 +3,7 @@ #ifndef cmCustomCommand_h #define cmCustomCommand_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmCustomCommandLines.h" #include "cmListFileCache.h" diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 8f4ff4b..67213ec 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -13,7 +13,7 @@ #include "cmSystemTools.h" #include "cm_auto_ptr.hxx" -#include <cmConfigure.h> +#include "cmConfigure.h" cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, const std::string& config, diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h index 286aaf3..0a2adb5 100644 --- a/Source/cmCustomCommandGenerator.h +++ b/Source/cmCustomCommandGenerator.h @@ -3,8 +3,8 @@ #ifndef cmCustomCommandGenerator_h #define cmCustomCommandGenerator_h +#include "cmConfigure.h" // IWYU pragma: keep #include "cmCustomCommandLines.h" -#include <cmConfigure.h> // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmCustomCommandLines.h b/Source/cmCustomCommandLines.h index 87ed4e8..36838f2 100644 --- a/Source/cmCustomCommandLines.h +++ b/Source/cmCustomCommandLines.h @@ -3,7 +3,7 @@ #ifndef cmCustomCommandLines_h #define cmCustomCommandLines_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmDefinePropertyCommand.h b/Source/cmDefinePropertyCommand.h index 02e5b88..7a6e127 100644 --- a/Source/cmDefinePropertyCommand.h +++ b/Source/cmDefinePropertyCommand.h @@ -3,7 +3,8 @@ #ifndef cmDefinesPropertyCommand_h #define cmDefinesPropertyCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 47fe76a..7aa7641 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDefinitions.h" +#include "cmConfigure.h" #include <assert.h> -#include <cmConfigure.h> #include <set> #include <utility> diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index ad40665..160e8e1 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -3,7 +3,7 @@ #ifndef cmDefinitions_h #define cmDefinitions_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index b8c76b9..c898d12 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -9,7 +9,7 @@ #include "cmSystemTools.h" #include "cmWorkingDirectory.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <sstream> #include <string.h> #include <utility> diff --git a/Source/cmDepends.h b/Source/cmDepends.h index f677f80..a80b585 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -3,7 +3,7 @@ #ifndef cmDepends_h #define cmDepends_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <map> diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 9d4b9cc..3b84516 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDependsC.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <utility> #include "cmAlgorithms.h" diff --git a/Source/cmDependsC.h b/Source/cmDependsC.h index 3b5eb62..4f52826 100644 --- a/Source/cmDependsC.h +++ b/Source/cmDependsC.h @@ -3,11 +3,11 @@ #ifndef cmDependsC_h #define cmDependsC_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmDepends.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <iosfwd> #include <map> #include <queue> diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 7927402..8b05fab 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDependsFortran.h" +#include "cmsys/FStream.hxx" #include <assert.h> -#include <cmsys/FStream.hxx> #include <iostream> #include <map> #include <stdlib.h> diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h index 90b82d4..a9a1ed3 100644 --- a/Source/cmDependsFortran.h +++ b/Source/cmDependsFortran.h @@ -3,7 +3,8 @@ #ifndef cmFortran_h #define cmFortran_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <iosfwd> #include <set> #include <string> diff --git a/Source/cmDependsJava.h b/Source/cmDependsJava.h index 1b9cca5..6efa51a 100644 --- a/Source/cmDependsJava.h +++ b/Source/cmDependsJava.h @@ -3,7 +3,7 @@ #ifndef cmDependsJava_h #define cmDependsJava_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmDepends.h" diff --git a/Source/cmDependsJavaParser.cxx b/Source/cmDependsJavaParser.cxx index b09bd0c..bc45d45 100644 --- a/Source/cmDependsJavaParser.cxx +++ b/Source/cmDependsJavaParser.cxx @@ -85,7 +85,7 @@ Modify cmDependsJavaParser.cxx: */ -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <stdlib.h> #include <string.h> diff --git a/Source/cmDependsJavaParser.y b/Source/cmDependsJavaParser.y index 150ac92..1137f39 100644 --- a/Source/cmDependsJavaParser.y +++ b/Source/cmDependsJavaParser.y @@ -14,7 +14,7 @@ Modify cmDependsJavaParser.cxx: */ -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <stdlib.h> #include <string.h> diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index f5998ef..7bc91bf 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -2,12 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDependsJavaParserHelper.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmDependsJavaLexer.h" #include "cmSystemTools.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <iostream> #include <stdio.h> #include <stdlib.h> diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h index 5f28f70..0b445d9 100644 --- a/Source/cmDependsJavaParserHelper.h +++ b/Source/cmDependsJavaParserHelper.h @@ -3,7 +3,7 @@ #ifndef cmDependsJavaParserHelper_h #define cmDependsJavaParserHelper_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmDisallowedCommand.h b/Source/cmDisallowedCommand.h index 00b0183..7c141dd 100644 --- a/Source/cmDisallowedCommand.h +++ b/Source/cmDisallowedCommand.h @@ -3,7 +3,8 @@ #ifndef cmDisallowedCommand_h #define cmDisallowedCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index cb24adf..5f25113 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -9,9 +9,9 @@ #include "cmSystemTools.h" #include "cmVersion.h" +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" #include <algorithm> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> #include <ctype.h> #include <string.h> #include <utility> diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index 66afd2c..2866fef 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -3,7 +3,7 @@ #ifndef _cmDocumentation_h #define _cmDocumentation_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmDocumentationFormatter.h" diff --git a/Source/cmDocumentationEntry.h b/Source/cmDocumentationEntry.h index 1ccb82d..ea43b88 100644 --- a/Source/cmDocumentationEntry.h +++ b/Source/cmDocumentationEntry.h @@ -3,7 +3,7 @@ #ifndef cmDocumentationEntry_h #define cmDocumentationEntry_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index ffa80f1..1f04250 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -3,7 +3,7 @@ #ifndef _cmDocumentationFormatter_h #define _cmDocumentationFormatter_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> diff --git a/Source/cmDocumentationSection.h b/Source/cmDocumentationSection.h index c1eb5c8..d9e8187 100644 --- a/Source/cmDocumentationSection.h +++ b/Source/cmDocumentationSection.h @@ -3,7 +3,7 @@ #ifndef _cmDocumentationSection_h #define _cmDocumentationSection_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmDocumentationEntry.h" diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx index 39a59fc..76a4a29 100644 --- a/Source/cmDynamicLoader.cxx +++ b/Source/cmDynamicLoader.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDynamicLoader.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <map> #include <string> diff --git a/Source/cmDynamicLoader.h b/Source/cmDynamicLoader.h index 5d69400..dd69b40 100644 --- a/Source/cmDynamicLoader.h +++ b/Source/cmDynamicLoader.h @@ -8,7 +8,7 @@ #ifndef cmDynamicLoader_h #define cmDynamicLoader_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmsys/DynamicLoader.hxx" // IWYU pragma: export diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 0655da9..2a8137f 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmELF.h" -#include <cm_auto_ptr.hxx> -#include <cm_kwiml.h> -#include <cmsys/FStream.hxx> +#include "cm_auto_ptr.hxx" +#include "cm_kwiml.h" +#include "cmsys/FStream.hxx" #include <map> #include <sstream> #include <stddef.h> diff --git a/Source/cmELF.h b/Source/cmELF.h index 763a240..a6e407f 100644 --- a/Source/cmELF.h +++ b/Source/cmELF.h @@ -3,7 +3,7 @@ #ifndef cmELF_h #define cmELF_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <string> diff --git a/Source/cmEnableLanguageCommand.h b/Source/cmEnableLanguageCommand.h index bafb79e..0748283 100644 --- a/Source/cmEnableLanguageCommand.h +++ b/Source/cmEnableLanguageCommand.h @@ -3,7 +3,8 @@ #ifndef cmEnableLanguageCommand_h #define cmEnableLanguageCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmEnableTestingCommand.h b/Source/cmEnableTestingCommand.h index 67cd237..b4ac068 100644 --- a/Source/cmEnableTestingCommand.h +++ b/Source/cmEnableTestingCommand.h @@ -3,7 +3,8 @@ #ifndef cmEnableTestingCommand_h #define cmEnableTestingCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index 6a7292d..fcc3c45 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExecProgramCommand.h" -#include <cmsys/Process.h> +#include "cmsys/Process.h" #include <stdio.h> #include "cmMakefile.h" diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h index 58e948e..53d35cf 100644 --- a/Source/cmExecProgramCommand.h +++ b/Source/cmExecProgramCommand.h @@ -3,7 +3,8 @@ #ifndef cmExecProgramCommand_h #define cmExecProgramCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 92cdf64..8c10dbe 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExecuteProcessCommand.h" -#include <cmsys/Process.h> +#include "cmsys/Process.h" #include <ctype.h> /* isspace */ #include <sstream> #include <stdio.h> diff --git a/Source/cmExecuteProcessCommand.h b/Source/cmExecuteProcessCommand.h index 9ce4338..65e16d4 100644 --- a/Source/cmExecuteProcessCommand.h +++ b/Source/cmExecuteProcessCommand.h @@ -3,7 +3,8 @@ #ifndef cmExecuteProcessCommand_h #define cmExecuteProcessCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmExpandedCommandArgument.h b/Source/cmExpandedCommandArgument.h index 9770fe6..fe86528 100644 --- a/Source/cmExpandedCommandArgument.h +++ b/Source/cmExpandedCommandArgument.h @@ -3,7 +3,7 @@ #ifndef cmExpandedCommandArgument_h #define cmExpandedCommandArgument_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmExportBuildAndroidMKGenerator.h b/Source/cmExportBuildAndroidMKGenerator.h index 2a5a42e..d028ef4 100644 --- a/Source/cmExportBuildAndroidMKGenerator.h +++ b/Source/cmExportBuildAndroidMKGenerator.h @@ -3,7 +3,7 @@ #ifndef cmExportBuildAndroidMKGenerator_h #define cmExportBuildAndroidMKGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <string> diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 0c25268..978a7a1 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportBuildFileGenerator.h" +#include "cmAlgorithms.h" #include "cmExportSet.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -21,6 +22,8 @@ #include <sstream> #include <utility> +class cmSourceFile; + cmExportBuildFileGenerator::cmExportBuildFileGenerator() { this->LG = CM_NULLPTR; @@ -171,29 +174,48 @@ void cmExportBuildFileGenerator::SetImportLocationProperty( // Get the makefile in which to lookup target information. cmMakefile* mf = target->Makefile; - // Add the main target file. - { - std::string prop = "IMPORTED_LOCATION"; + if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) { + std::string prop = "IMPORTED_OBJECTS"; prop += suffix; - std::string value; - if (target->IsAppBundleOnApple()) { - value = target->GetFullPath(config, false); - } else { - value = target->GetFullPath(config, false, true); + + // Compute all the object files inside this target and setup + // IMPORTED_OBJECTS as a list of object files + std::vector<cmSourceFile const*> objectSources; + target->GetObjectSources(objectSources, config); + std::string const obj_dir = target->GetObjectDirectory(config); + std::vector<std::string> objects; + for (std::vector<cmSourceFile const*>::const_iterator si = + objectSources.begin(); + si != objectSources.end(); ++si) { + const std::string& obj = target->GetObjectName(*si); + objects.push_back(obj_dir + obj); } - properties[prop] = value; - } - // Add the import library for windows DLLs. - if (target->IsDLLPlatform() && - (target->GetType() == cmStateEnums::SHARED_LIBRARY || - target->IsExecutableWithExports()) && - mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) { - std::string prop = "IMPORTED_IMPLIB"; - prop += suffix; - std::string value = target->GetFullPath(config, true); - target->GetImplibGNUtoMS(value, value, "${CMAKE_IMPORT_LIBRARY_SUFFIX}"); - properties[prop] = value; + // Store the property. + properties[prop] = cmJoin(objects, ";"); + } else { + // Add the main target file. + { + std::string prop = "IMPORTED_LOCATION"; + prop += suffix; + std::string value; + if (target->IsAppBundleOnApple()) { + value = target->GetFullPath(config, false); + } else { + value = target->GetFullPath(config, false, true); + } + properties[prop] = value; + } + + // Add the import library for windows DLLs. + if (target->HasImportLibrary() && + mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) { + std::string prop = "IMPORTED_IMPLIB"; + prop += suffix; + std::string value = target->GetFullPath(config, true); + target->GetImplibGNUtoMS(value, value, "${CMAKE_IMPORT_LIBRARY_SUFFIX}"); + properties[prop] = value; + } } } diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h index 0539b6a..0556983 100644 --- a/Source/cmExportBuildFileGenerator.h +++ b/Source/cmExportBuildFileGenerator.h @@ -3,7 +3,7 @@ #ifndef cmExportBuildFileGenerator_h #define cmExportBuildFileGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmExportFileGenerator.h" diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 09c01e9..38cd511 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportCommand.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <map> #include <sstream> @@ -149,11 +149,15 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args, if (cmTarget* target = gg->FindTarget(*currentTarget)) { if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) { - std::ostringstream e; - e << "given OBJECT library \"" << *currentTarget - << "\" which may not be exported."; - this->SetError(e.str()); - return false; + std::string reason; + if (!this->Makefile->GetGlobalGenerator() + ->HasKnownObjectFileLocation(&reason)) { + std::ostringstream e; + e << "given OBJECT library \"" << *currentTarget + << "\" which may not be exported" << reason << "."; + this->SetError(e.str()); + return false; + } } if (target->GetType() == cmStateEnums::UTILITY) { this->SetError("given custom target \"" + *currentTarget + diff --git a/Source/cmExportCommand.h b/Source/cmExportCommand.h index a0224d0..b95ea86 100644 --- a/Source/cmExportCommand.h +++ b/Source/cmExportCommand.h @@ -3,7 +3,8 @@ #ifndef cmExportCommand_h #define cmExportCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 6c21eaf..ae3ec3b 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -17,9 +17,9 @@ #include "cmTargetExport.h" #include "cmake.h" +#include "cm_auto_ptr.hxx" +#include "cmsys/FStream.hxx" #include <assert.h> -#include <cm_auto_ptr.hxx> -#include <cmsys/FStream.hxx> #include <sstream> #include <string.h> #include <utility> @@ -441,6 +441,11 @@ void getCompatibleInterfaceProperties(cmGeneratorTarget* target, std::set<std::string>& ifaceProperties, const std::string& config) { + if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) { + // object libraries have no link information, so nothing to compute + return; + } + cmComputeLinkInformation* info = target->GetLinkInformation(config); if (!info) { @@ -927,6 +932,9 @@ void cmExportFileGenerator::GenerateImportTargetCode( case cmStateEnums::UNKNOWN_LIBRARY: os << "add_library(" << targetName << " UNKNOWN IMPORTED)\n"; break; + case cmStateEnums::OBJECT_LIBRARY: + os << "add_library(" << targetName << " OBJECT IMPORTED)\n"; + break; case cmStateEnums::INTERFACE_LIBRARY: os << "add_library(" << targetName << " INTERFACE IMPORTED)\n"; break; diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index e7712d2..985c8f6 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -3,7 +3,7 @@ #ifndef cmExportFileGenerator_h #define cmExportFileGenerator_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmGeneratorExpression.h" #include "cmVersion.h" diff --git a/Source/cmExportInstallAndroidMKGenerator.h b/Source/cmExportInstallAndroidMKGenerator.h index f2f8927..ebef783 100644 --- a/Source/cmExportInstallAndroidMKGenerator.h +++ b/Source/cmExportInstallAndroidMKGenerator.h @@ -3,7 +3,7 @@ #ifndef cmExportInstallAndroidMKGenerator_h #define cmExportInstallAndroidMKGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <set> diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 3b76a87..16bd5e8 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -331,6 +331,8 @@ void cmExportInstallFileGenerator::GenerateImportTargetsConfig( properties, importedLocations); this->SetImportLocationProperty(config, suffix, te->RuntimeGenerator, properties, importedLocations); + this->SetImportLocationProperty(config, suffix, te->ObjectsGenerator, + properties, importedLocations); this->SetImportLocationProperty(config, suffix, te->FrameworkGenerator, properties, importedLocations); this->SetImportLocationProperty(config, suffix, te->BundleGenerator, @@ -397,6 +399,23 @@ void cmExportInstallFileGenerator::SetImportLocationProperty( // Store the property. properties[prop] = value; importedLocations.insert(prop); + } else if (itgen->GetTarget()->GetType() == cmStateEnums::OBJECT_LIBRARY) { + // Construct the property name. + std::string prop = "IMPORTED_OBJECTS"; + prop += suffix; + + // Compute all the object files inside this target and setup + // IMPORTED_OBJECTS as a list of object files + std::vector<std::string> objects; + itgen->GetInstallObjectNames(config, objects); + for (std::vector<std::string>::iterator i = objects.begin(); + i != objects.end(); ++i) { + *i = value + *i; + } + + // Store the property. + properties[prop] = cmJoin(objects, ";"); + importedLocations.insert(prop); } else { // Construct the property name. std::string prop = "IMPORTED_LOCATION"; diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h index 3c9777a..8fa9b7f 100644 --- a/Source/cmExportInstallFileGenerator.h +++ b/Source/cmExportInstallFileGenerator.h @@ -3,7 +3,7 @@ #ifndef cmExportInstallFileGenerator_h #define cmExportInstallFileGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmExportFileGenerator.h" diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index deecad8..69150ae 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportLibraryDependenciesCommand.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <map> #include <utility> diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h index be53349..4d3e36e 100644 --- a/Source/cmExportLibraryDependenciesCommand.h +++ b/Source/cmExportLibraryDependenciesCommand.h @@ -3,7 +3,8 @@ #ifndef cmExportLibraryDependenciesCommand_h #define cmExportLibraryDependenciesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmExportSet.h b/Source/cmExportSet.h index 420f472..58ad617 100644 --- a/Source/cmExportSet.h +++ b/Source/cmExportSet.h @@ -3,7 +3,7 @@ #ifndef cmExportSet_h #define cmExportSet_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmExportSetMap.h b/Source/cmExportSetMap.h index 5090692..0f71c79 100644 --- a/Source/cmExportSetMap.h +++ b/Source/cmExportSetMap.h @@ -3,7 +3,7 @@ #ifndef cmExportSetMap_h #define cmExportSetMap_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h index 88a70a1..9671fac 100644 --- a/Source/cmExportTryCompileFileGenerator.h +++ b/Source/cmExportTryCompileFileGenerator.h @@ -3,7 +3,7 @@ #ifndef cmExportTryCompileFileGenerator_h #define cmExportTryCompileFileGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmExportFileGenerator.h" diff --git a/Source/cmExprParser.cxx b/Source/cmExprParser.cxx index a9088a6..19efca1 100644 --- a/Source/cmExprParser.cxx +++ b/Source/cmExprParser.cxx @@ -85,7 +85,7 @@ Modify cmExprParser.cxx: */ -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <stdlib.h> #include <string.h> diff --git a/Source/cmExprParser.y b/Source/cmExprParser.y index 0429663..220f7c8 100644 --- a/Source/cmExprParser.y +++ b/Source/cmExprParser.y @@ -14,7 +14,7 @@ Modify cmExprParser.cxx: */ -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <stdlib.h> #include <string.h> diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx index 1b49def..c3f026a 100644 --- a/Source/cmExprParserHelper.cxx +++ b/Source/cmExprParserHelper.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExprParserHelper.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmExprLexer.h" diff --git a/Source/cmExprParserHelper.h b/Source/cmExprParserHelper.h index df365fc..dcdaca9 100644 --- a/Source/cmExprParserHelper.h +++ b/Source/cmExprParserHelper.h @@ -3,7 +3,7 @@ #ifndef cmExprParserHelper_h #define cmExprParserHelper_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h index c49d39b..6b89037 100644 --- a/Source/cmExternalMakefileProjectGenerator.h +++ b/Source/cmExternalMakefileProjectGenerator.h @@ -3,7 +3,7 @@ #ifndef cmExternalMakefileProjectGenerator_h #define cmExternalMakefileProjectGenerator_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h index 06aadc4..450a9d0 100644 --- a/Source/cmExtraCodeBlocksGenerator.h +++ b/Source/cmExtraCodeBlocksGenerator.h @@ -3,7 +3,7 @@ #ifndef cmExtraCodeBlocksGenerator_h #define cmExtraCodeBlocksGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmExternalMakefileProjectGenerator.h" diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index 856d42e..98eebe6 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -13,7 +13,7 @@ #include "cmXMLWriter.h" #include "cmake.h" -#include <cmsys/SystemInformation.hxx> +#include "cmsys/SystemInformation.hxx" #include <map> #include <set> #include <sstream> diff --git a/Source/cmExtraCodeLiteGenerator.h b/Source/cmExtraCodeLiteGenerator.h index 3263eb6..de33098 100644 --- a/Source/cmExtraCodeLiteGenerator.h +++ b/Source/cmExtraCodeLiteGenerator.h @@ -3,7 +3,7 @@ #ifndef cmGlobalCodeLiteGenerator_h #define cmGlobalCodeLiteGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmExternalMakefileProjectGenerator.h" diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index b4fc771..8d1adc7 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExtraEclipseCDT4Generator.h" +#include "cmsys/RegularExpression.hxx" #include <algorithm> #include <assert.h> -#include <cmsys/RegularExpression.hxx> #include <map> #include <sstream> #include <stdio.h> diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h index fe71172..1380d18 100644 --- a/Source/cmExtraEclipseCDT4Generator.h +++ b/Source/cmExtraEclipseCDT4Generator.h @@ -3,7 +3,7 @@ #ifndef cmExtraEclipseCDT4Generator_h #define cmExtraEclipseCDT4Generator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmExternalMakefileProjectGenerator.h" diff --git a/Source/cmExtraKateGenerator.h b/Source/cmExtraKateGenerator.h index badaca9..6b9c7af 100644 --- a/Source/cmExtraKateGenerator.h +++ b/Source/cmExtraKateGenerator.h @@ -3,7 +3,7 @@ #ifndef cmExtraKateGenerator_h #define cmExtraKateGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmExternalMakefileProjectGenerator.h" diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 36ba520..1fd1418 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExtraSublimeTextGenerator.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <set> #include <sstream> #include <string.h> diff --git a/Source/cmExtraSublimeTextGenerator.h b/Source/cmExtraSublimeTextGenerator.h index a860d34..9022d37 100644 --- a/Source/cmExtraSublimeTextGenerator.h +++ b/Source/cmExtraSublimeTextGenerator.h @@ -3,7 +3,7 @@ #ifndef cmExtraSublimeTextGenerator_h #define cmExtraSublimeTextGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmExternalMakefileProjectGenerator.h" diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h index 835f0a7..7dde9c1 100644 --- a/Source/cmFLTKWrapUICommand.h +++ b/Source/cmFLTKWrapUICommand.h @@ -3,7 +3,8 @@ #ifndef cmFLTKWrapUICommand_h #define cmFLTKWrapUICommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 63012a5..034a266 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2,14 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileCommand.h" +#include "cm_kwiml.h" +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" +#include "cmsys/RegularExpression.hxx" +#include "cmsys/String.hxx" #include <algorithm> #include <assert.h> -#include <cm_kwiml.h> -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/RegularExpression.hxx> -#include <cmsys/String.hxx> #include <list> #include <sstream> #include <stdio.h> @@ -37,7 +37,7 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmCurl.h" #include "cmFileLockResult.h" -#include <cm_curl.h> +#include "cm_curl.h" #endif #if defined(CMAKE_USE_ELF_PARSER) @@ -1147,6 +1147,7 @@ protected: bool UseGivenPermissionsDir; bool UseSourcePermissions; std::string Destination; + std::string FilesFromDir; std::vector<std::string> Files; int Doing; @@ -1156,6 +1157,7 @@ protected: DoingNone, DoingError, DoingDestination, + DoingFilesFromDir, DoingFiles, DoingPattern, DoingRegex, @@ -1251,6 +1253,12 @@ bool cmFileCopier::CheckKeyword(std::string const& arg) } else { this->Doing = DoingDestination; } + } else if (arg == "FILES_FROM_DIR") { + if (this->CurrentMatchRule) { + this->NotAfterMatch(arg); + } else { + this->Doing = DoingFilesFromDir; + } } else if (arg == "PATTERN") { this->Doing = DoingPattern; } else if (arg == "REGEX") { @@ -1314,13 +1322,7 @@ bool cmFileCopier::CheckValue(std::string const& arg) { switch (this->Doing) { case DoingFiles: - if (arg.empty() || cmSystemTools::FileIsFullPath(arg.c_str())) { - this->Files.push_back(arg); - } else { - std::string file = this->Makefile->GetCurrentSourceDirectory(); - file += "/" + arg; - this->Files.push_back(file); - } + this->Files.push_back(arg); break; case DoingDestination: if (arg.empty() || cmSystemTools::FileIsFullPath(arg.c_str())) { @@ -1331,6 +1333,16 @@ bool cmFileCopier::CheckValue(std::string const& arg) } this->Doing = DoingNone; break; + case DoingFilesFromDir: + if (cmSystemTools::FileIsFullPath(arg.c_str())) { + this->FilesFromDir = arg; + } else { + this->FilesFromDir = this->Makefile->GetCurrentSourceDirectory(); + this->FilesFromDir += "/" + arg; + } + cmSystemTools::ConvertToUnixSlashes(this->FilesFromDir); + this->Doing = DoingNone; + break; case DoingPattern: { // Convert the pattern to a regular expression. Require a // leading slash and trailing end-of-string in the matched @@ -1390,17 +1402,41 @@ bool cmFileCopier::Run(std::vector<std::string> const& args) return false; } - std::vector<std::string> const& files = this->Files; - for (std::vector<std::string>::size_type i = 0; i < files.size(); ++i) { + for (std::vector<std::string>::const_iterator i = this->Files.begin(); + i != this->Files.end(); ++i) { + std::string file; + if (!i->empty() && !cmSystemTools::FileIsFullPath(*i)) { + if (!this->FilesFromDir.empty()) { + file = this->FilesFromDir; + } else { + file = this->Makefile->GetCurrentSourceDirectory(); + } + file += "/"; + file += *i; + } else if (!this->FilesFromDir.empty()) { + this->FileCommand->SetError("option FILES_FROM_DIR requires all files " + "to be specified as relative paths."); + return false; + } else { + file = *i; + } + // Split the input file into its directory and name components. std::vector<std::string> fromPathComponents; - cmSystemTools::SplitPath(files[i], fromPathComponents); + cmSystemTools::SplitPath(file, fromPathComponents); std::string fromName = *(fromPathComponents.end() - 1); std::string fromDir = cmSystemTools::JoinPath( fromPathComponents.begin(), fromPathComponents.end() - 1); // Compute the full path to the destination file. std::string toFile = this->Destination; + if (!this->FilesFromDir.empty()) { + std::string dir = cmSystemTools::GetFilenamePath(*i); + if (!dir.empty()) { + toFile += "/"; + toFile += dir; + } + } std::string const& toName = this->ToName(fromName); if (!toName.empty()) { toFile += "/"; @@ -1751,6 +1787,11 @@ bool cmFileInstaller::Parse(std::vector<std::string> const& args) } if (!this->Rename.empty()) { + if (!this->FilesFromDir.empty()) { + this->FileCommand->SetError("INSTALL option RENAME may not be " + "combined with FILES_FROM_DIR."); + return false; + } if (this->InstallType != cmInstallType_FILES && this->InstallType != cmInstallType_PROGRAMS) { this->FileCommand->SetError("INSTALL option RENAME may be used " diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index 2d82a23..121fec0 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -3,7 +3,8 @@ #ifndef cmFileCommand_h #define cmFileCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h index ab3cb1f..8f996cf 100644 --- a/Source/cmFileLock.h +++ b/Source/cmFileLock.h @@ -3,7 +3,7 @@ #ifndef cmFileLock_h #define cmFileLock_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h index fbe01c8..09c984c 100644 --- a/Source/cmFileLockPool.h +++ b/Source/cmFileLockPool.h @@ -3,7 +3,7 @@ #ifndef cmFileLockPool_h #define cmFileLockPool_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <list> #include <string> diff --git a/Source/cmFileLockResult.h b/Source/cmFileLockResult.h index 679432a..4cedc0a 100644 --- a/Source/cmFileLockResult.h +++ b/Source/cmFileLockResult.h @@ -3,7 +3,7 @@ #ifndef cmFileLockResult_h #define cmFileLockResult_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx index 909be78..9e66035 100644 --- a/Source/cmFileMonitor.cxx +++ b/Source/cmFileMonitor.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileMonitor.h" -#include <cmsys/SystemTools.hxx> +#include "cmsys/SystemTools.hxx" #include <cassert> #include <iostream> diff --git a/Source/cmFileMonitor.h b/Source/cmFileMonitor.h index 2957328..8574db0 100644 --- a/Source/cmFileMonitor.h +++ b/Source/cmFileMonitor.h @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #pragma once -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <functional> #include <string> diff --git a/Source/cmFilePathChecksum.h b/Source/cmFilePathChecksum.h index 59ca34c..9d570eb 100644 --- a/Source/cmFilePathChecksum.h +++ b/Source/cmFilePathChecksum.h @@ -3,7 +3,7 @@ #ifndef cmFilePathChecksum_h #define cmFilePathChecksum_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <stddef.h> #include <string> diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index ef4337b..f591a8d 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -13,7 +13,7 @@ #include "cm_sys_stat.h" #define cmFileTimeComparison_Type struct stat #else -#include <cmsys/Encoding.hxx> +#include "cmsys/Encoding.hxx" #include <windows.h> #define cmFileTimeComparison_Type FILETIME #endif diff --git a/Source/cmFileTimeComparison.h b/Source/cmFileTimeComparison.h index 6eb1500..b1f8ed6 100644 --- a/Source/cmFileTimeComparison.h +++ b/Source/cmFileTimeComparison.h @@ -3,7 +3,7 @@ #ifndef cmFileTimeComparison_h #define cmFileTimeComparison_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep class cmFileTimeComparisonInternal; diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index dce5021..068dcfc 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindBase.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iostream> #include <map> #include <stddef.h> diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h index 423d453..81494f1 100644 --- a/Source/cmFindBase.h +++ b/Source/cmFindBase.h @@ -3,7 +3,7 @@ #ifndef cmFindBase_h #define cmFindBase_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h index 4d6d569..426d233 100644 --- a/Source/cmFindCommon.h +++ b/Source/cmFindCommon.h @@ -3,7 +3,7 @@ #ifndef cmFindCommon_h #define cmFindCommon_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <map> #include <set> diff --git a/Source/cmFindFileCommand.h b/Source/cmFindFileCommand.h index 5c94ebf..489df65 100644 --- a/Source/cmFindFileCommand.h +++ b/Source/cmFindFileCommand.h @@ -3,7 +3,8 @@ #ifndef cmFindFileCommand_h #define cmFindFileCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include "cmFindPathCommand.h" diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index e92d672..562a9fc 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindLibraryCommand.h" +#include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <cmsys/RegularExpression.hxx> #include <set> #include <stdio.h> #include <string.h> diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h index aeff629..4a60505 100644 --- a/Source/cmFindLibraryCommand.h +++ b/Source/cmFindLibraryCommand.h @@ -3,7 +3,8 @@ #ifndef cmFindLibraryCommand_h #define cmFindLibraryCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index fe4cc54..17fa92c 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -2,14 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindPackageCommand.h" +#include "cmSystemTools.h" +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" +#include "cmsys/RegularExpression.hxx" +#include "cmsys/String.h" #include <algorithm> #include <assert.h> -#include <cmSystemTools.h> -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/RegularExpression.hxx> -#include <cmsys/String.h> #include <functional> #include <iterator> #include <sstream> diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index 61a8dd6..c42ecce 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -3,8 +3,9 @@ #ifndef cmFindPackageCommand_h #define cmFindPackageCommand_h -#include <cmConfigure.h> -#include <cm_kwiml.h> +#include "cmConfigure.h" + +#include "cm_kwiml.h" #include <map> #include <set> #include <string> diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 8d4bcf3..644b025 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindPathCommand.h" -#include <cmsys/Glob.hxx> +#include "cmsys/Glob.hxx" #include "cmMakefile.h" #include "cmStateTypes.h" diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h index edeeb3a..205bb17 100644 --- a/Source/cmFindPathCommand.h +++ b/Source/cmFindPathCommand.h @@ -3,7 +3,8 @@ #ifndef cmFindPathCommand_h #define cmFindPathCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h index dc17803..73894ba 100644 --- a/Source/cmFindProgramCommand.h +++ b/Source/cmFindProgramCommand.h @@ -3,7 +3,8 @@ #ifndef cmFindProgramCommand_h #define cmFindProgramCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h index 93c4676..c71b905 100644 --- a/Source/cmForEachCommand.h +++ b/Source/cmForEachCommand.h @@ -3,7 +3,8 @@ #ifndef cmForEachCommand_h #define cmForEachCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmFortranParser.cxx b/Source/cmFortranParser.cxx index c67227f..2b3452f 100644 --- a/Source/cmFortranParser.cxx +++ b/Source/cmFortranParser.cxx @@ -97,9 +97,9 @@ Modify cmFortranParser.cxx: - "#if 0" out yyerrorlab block in range ["goto yyerrlab1", "yyerrlab1:"] */ -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep -#include <cmsys/String.h> +#include "cmsys/String.h" #include <stdlib.h> #include <string.h> diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h index 024b00a..d8b0023 100644 --- a/Source/cmFortranParser.h +++ b/Source/cmFortranParser.h @@ -4,7 +4,7 @@ #define cmFortranParser_h #if !defined(cmFortranLexer_cxx) && !defined(cmFortranParser_cxx) -#include <cmConfigure.h> +#include "cmConfigure.h" #include <set> #include <string> diff --git a/Source/cmFortranParser.y b/Source/cmFortranParser.y index 3d68134..acfb40a 100644 --- a/Source/cmFortranParser.y +++ b/Source/cmFortranParser.y @@ -26,9 +26,9 @@ Modify cmFortranParser.cxx: - "#if 0" out yyerrorlab block in range ["goto yyerrlab1", "yyerrlab1:"] */ -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep -#include <cmsys/String.h> +#include "cmsys/String.h" #include <stdlib.h> #include <string.h> diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx index 1abe673..4e23f36 100644 --- a/Source/cmFortranParserImpl.cxx +++ b/Source/cmFortranParserImpl.cxx @@ -3,8 +3,8 @@ #include "cmFortranParser.h" #include "cmSystemTools.h" +#include "cmConfigure.h" #include <assert.h> -#include <cmConfigure.h> #include <set> #include <stack> #include <stdio.h> diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h index afea6f9..d6cc18e 100644 --- a/Source/cmFunctionCommand.h +++ b/Source/cmFunctionCommand.h @@ -3,7 +3,8 @@ #ifndef cmFunctionCommand_h #define cmFunctionCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 4731493..6aa593c 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -8,7 +8,7 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cm_codecvt.hxx" -#include <cm_zlib.h> +#include "cm_zlib.h" #endif cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding) diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index a027b01..56f9988 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -3,10 +3,10 @@ #ifndef cmGeneratedFileStream_h #define cmGeneratedFileStream_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cm_codecvt.hxx> -#include <cmsys/FStream.hxx> +#include "cm_codecvt.hxx" +#include "cmsys/FStream.hxx" #include <string> // This is the first base class of cmGeneratedFileStream. It will be diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index e70bbfe..570aa6e 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorExpression.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <utility> #include "assert.h" diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 8f82a6b..694ce8a 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -3,11 +3,11 @@ #ifndef cmGeneratorExpression_h #define cmGeneratorExpression_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmListFileCache.h" -#include <cm_auto_ptr.hxx> +#include "cm_auto_ptr.hxx" #include <map> #include <set> #include <string> diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index 8f10259..557a192 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -3,7 +3,7 @@ #ifndef cmGeneratorExpressionDAGChecker_h #define cmGeneratorExpressionDAGChecker_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmListFileCache.h" diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index aeb005f..1526454 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorExpressionEvaluationFile.h" -#include <cmConfigure.h> -#include <cmsys/FStream.hxx> +#include "cmConfigure.h" +#include "cmsys/FStream.hxx" #include <sstream> #include <utility> @@ -64,8 +64,10 @@ void cmGeneratorExpressionEvaluationFile::Generate( return; } std::ostringstream e; - e << "Evaluation file to be written multiple times for different " - "configurations or languages with different content:\n " + e << "Evaluation file to be written multiple times with different " + "content. " + "This is generally caused by the content evaluating the " + "configuration type, language, or location of object files:\n " << outputFileName; lg->IssueMessage(cmake::FATAL_ERROR, e.str()); return; diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h index 1223ffd..9872746 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.h +++ b/Source/cmGeneratorExpressionEvaluationFile.h @@ -3,7 +3,7 @@ #ifndef cmGeneratorExpressionEvaluationFile_h #define cmGeneratorExpressionEvaluationFile_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h index 41bea9b..a6a341b 100644 --- a/Source/cmGeneratorExpressionEvaluator.h +++ b/Source/cmGeneratorExpressionEvaluator.h @@ -3,7 +3,7 @@ #ifndef cmGeneratorExpressionEvaluator_h #define cmGeneratorExpressionEvaluator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <stddef.h> #include <string> diff --git a/Source/cmGeneratorExpressionLexer.h b/Source/cmGeneratorExpressionLexer.h index cac255d..e53f0b5 100644 --- a/Source/cmGeneratorExpressionLexer.h +++ b/Source/cmGeneratorExpressionLexer.h @@ -3,7 +3,7 @@ #ifndef cmGeneratorExpressionLexer_h #define cmGeneratorExpressionLexer_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <stddef.h> #include <string> diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 8b2c7aa..77a4962 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -20,11 +20,11 @@ #include "cm_auto_ptr.hxx" #include "cmake.h" +#include "cmConfigure.h" +#include "cmsys/RegularExpression.hxx" +#include "cmsys/String.h" #include <algorithm> #include <assert.h> -#include <cmConfigure.h> -#include <cmsys/RegularExpression.hxx> -#include <cmsys/String.h> #include <errno.h> #include <map> #include <set> @@ -33,8 +33,6 @@ #include <string.h> #include <utility> -class cmSourceFile; - std::string cmGeneratorExpressionNode::EvaluateDependentExpression( std::string const& prop, cmLocalGenerator* lg, cmGeneratorExpressionContext* context, cmGeneratorTarget const* headTarget, @@ -1228,15 +1226,6 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode cmGeneratorExpressionDAGChecker* /*dagChecker*/) const CM_OVERRIDE { - if (!context->EvaluateForBuildsystem) { - std::ostringstream e; - e << "The evaluation of the TARGET_OBJECTS generator expression " - "is only suitable for consumption by CMake. It is not suitable " - "for writing out elsewhere."; - reportError(context, content->GetOriginalExpression(), e.str()); - return std::string(); - } - std::string tgtName = parameters.front(); cmGeneratorTarget* gt = context->LG->FindGeneratorTargetToUse(tgtName); if (!gt) { @@ -1253,39 +1242,60 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode reportError(context, content->GetOriginalExpression(), e.str()); return std::string(); } + if (!context->EvaluateForBuildsystem) { + cmGlobalGenerator* gg = context->LG->GetGlobalGenerator(); + std::string reason; + if (!gg->HasKnownObjectFileLocation(&reason)) { + std::ostringstream e; + e << "The evaluation of the TARGET_OBJECTS generator expression " + "is only suitable for consumption by CMake (limited" + << reason << "). " + "It is not suitable for writing out elsewhere."; + reportError(context, content->GetOriginalExpression(), e.str()); + return std::string(); + } + } - std::vector<cmSourceFile const*> objectSources; - gt->GetObjectSources(objectSources, context->Config); - std::map<cmSourceFile const*, std::string> mapping; + std::vector<std::string> objects; - for (std::vector<cmSourceFile const*>::const_iterator it = - objectSources.begin(); - it != objectSources.end(); ++it) { - mapping[*it]; - } + if (gt->IsImported()) { + const char* loc = CM_NULLPTR; + const char* imp = CM_NULLPTR; + std::string suffix; + if (gt->Target->GetMappedConfig(context->Config, &loc, &imp, suffix)) { + cmSystemTools::ExpandListArgument(loc, objects); + } + context->HadContextSensitiveCondition = true; + } else { + gt->GetTargetObjectNames(context->Config, objects); + + std::string obj_dir; + if (context->EvaluateForBuildsystem) { + // Use object file directory with buildsystem placeholder. + obj_dir = gt->ObjectDirectory; + // Here we assume that the set of object files produced + // by an object library does not vary with configuration + // and do not set HadContextSensitiveCondition to true. + } else { + // Use object file directory with per-config location. + obj_dir = gt->GetObjectDirectory(context->Config); + context->HadContextSensitiveCondition = true; + } - gt->LocalGenerator->ComputeObjectFilenames(mapping, gt); + for (std::vector<std::string>::iterator oi = objects.begin(); + oi != objects.end(); ++oi) { + *oi = obj_dir + *oi; + } + } + // Create the cmSourceFile instances in the referencing directory. cmMakefile* mf = context->LG->GetMakefile(); - - std::string obj_dir = gt->ObjectDirectory; - std::string result; - const char* sep = ""; - for (std::vector<cmSourceFile const*>::const_iterator it = - objectSources.begin(); - it != objectSources.end(); ++it) { - // Find the object file name corresponding to this source file. - std::map<cmSourceFile const*, std::string>::const_iterator map_it = - mapping.find(*it); - // It must exist because we populated the mapping just above. - assert(!map_it->second.empty()); - result += sep; - std::string objFile = obj_dir + map_it->second; - mf->AddTargetObject(tgtName, objFile); - result += objFile; - sep = ";"; + for (std::vector<std::string>::iterator oi = objects.begin(); + oi != objects.end(); ++oi) { + mf->AddTargetObject(tgtName, *oi); } - return result; + + return cmJoin(objects, ";"); } } targetObjectsNode; diff --git a/Source/cmGeneratorExpressionNode.h b/Source/cmGeneratorExpressionNode.h index ecf745e..ece1c11 100644 --- a/Source/cmGeneratorExpressionNode.h +++ b/Source/cmGeneratorExpressionNode.h @@ -3,7 +3,7 @@ #ifndef cmGeneratorExpressionNode_h #define cmGeneratorExpressionNode_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmGeneratorExpressionParser.h b/Source/cmGeneratorExpressionParser.h index e30cb20..633381c 100644 --- a/Source/cmGeneratorExpressionParser.h +++ b/Source/cmGeneratorExpressionParser.h @@ -3,7 +3,7 @@ #ifndef cmGeneratorExpressionParser_h #define cmGeneratorExpressionParser_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <vector> diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 6779641..2799505 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorTarget.h" +#include "cmsys/RegularExpression.hxx" #include <algorithm> #include <assert.h> -#include <cmsys/RegularExpression.hxx> #include <errno.h> #include <iterator> #include <queue> @@ -547,12 +547,6 @@ void cmGeneratorTarget::GetModuleDefinitionSources( IMPLEMENT_VISIT(SourceKindModuleDefinition); } -void cmGeneratorTarget::GetIDLSources(std::vector<cmSourceFile const*>& data, - const std::string& config) const -{ - IMPLEMENT_VISIT(SourceKindIDL); -} - void cmGeneratorTarget::GetHeaderSources( std::vector<cmSourceFile const*>& data, const std::string& config) const { @@ -947,6 +941,26 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<std::string>& files, void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*>& files, const std::string& config) const { + if (!this->GlobalGenerator->GetConfigureDoneCMP0026()) { + // Since we are still configuring not all sources may exist yet, + // so we need to avoid full source classification because that + // requires the absolute paths to all sources to be determined. + // Since this is only for compatibility with old policies that + // projects should not depend on anymore, just compute the files + // without memoizing them. + std::vector<std::string> srcs; + this->GetSourceFiles(srcs, config); + std::set<cmSourceFile*> emitted; + for (std::vector<std::string>::const_iterator i = srcs.begin(); + i != srcs.end(); ++i) { + cmSourceFile* sf = this->Makefile->GetOrCreateSource(*i); + if (emitted.insert(sf).second) { + files.push_back(sf); + } + } + return; + } + KindedSources const& kinded = this->GetKindedSources(config); files.reserve(kinded.Sources.size()); for (std::vector<SourceAndKind>::const_iterator si = kinded.Sources.begin(); @@ -955,6 +969,19 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*>& files, } } +void cmGeneratorTarget::GetSourceFilesWithoutObjectLibraries( + std::vector<cmSourceFile*>& files, const std::string& config) const +{ + KindedSources const& kinded = this->GetKindedSources(config); + files.reserve(kinded.Sources.size()); + for (std::vector<SourceAndKind>::const_iterator si = kinded.Sources.begin(); + si != kinded.Sources.end(); ++si) { + if (si->Source->GetObjectLibrary().empty()) { + files.push_back(si->Source); + } + } +} + cmGeneratorTarget::KindedSources const& cmGeneratorTarget::GetKindedSources( std::string const& config) const { @@ -1075,6 +1102,43 @@ void cmGeneratorTarget::ComputeKindedSources(KindedSources& files, } } +std::vector<cmGeneratorTarget::AllConfigSource> const& +cmGeneratorTarget::GetAllConfigSources() const +{ + if (this->AllConfigSources.empty()) { + this->ComputeAllConfigSources(); + } + return this->AllConfigSources; +} + +void cmGeneratorTarget::ComputeAllConfigSources() const +{ + std::vector<std::string> configs; + this->Makefile->GetConfigurations(configs); + + std::map<cmSourceFile const*, size_t> index; + + for (size_t ci = 0; ci < configs.size(); ++ci) { + KindedSources const& sources = this->GetKindedSources(configs[ci]); + for (std::vector<cmGeneratorTarget::SourceAndKind>::const_iterator si = + sources.Sources.begin(); + si != sources.Sources.end(); ++si) { + std::map<cmSourceFile const*, size_t>::iterator mi = + index.find(si->Source); + if (mi == index.end()) { + AllConfigSource acs; + acs.Source = si->Source; + acs.Kind = si->Kind; + this->AllConfigSources.push_back(acs); + std::map<cmSourceFile const*, size_t>::value_type entry( + si->Source, this->AllConfigSources.size() - 1); + mi = index.insert(entry).first; + } + this->AllConfigSources[mi->second].Configs.push_back(ci); + } + } +} + std::string cmGeneratorTarget::GetCompilePDBName( const std::string& config) const { @@ -1943,41 +2007,6 @@ bool cmGeneratorTarget::IsDLLPlatform() const return this->DLLPlatform; } -void cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs, - const std::string& config) const -{ - std::vector<cmSourceFile const*> objectFiles; - this->GetExternalObjects(objectFiles, config); - std::vector<cmGeneratorTarget*> objectLibraries; - for (std::vector<cmSourceFile const*>::const_iterator it = - objectFiles.begin(); - it != objectFiles.end(); ++it) { - std::string objLib = (*it)->GetObjectLibrary(); - if (cmGeneratorTarget* tgt = - this->LocalGenerator->FindGeneratorTargetToUse(objLib)) { - objectLibraries.push_back(tgt); - } - } - - std::vector<cmGeneratorTarget*>::const_iterator end = - cmRemoveDuplicates(objectLibraries); - - for (std::vector<cmGeneratorTarget*>::const_iterator ti = - objectLibraries.begin(); - ti != end; ++ti) { - cmGeneratorTarget* ogt = *ti; - std::vector<cmSourceFile const*> objectSources; - ogt->GetObjectSources(objectSources, config); - for (std::vector<cmSourceFile const*>::const_iterator si = - objectSources.begin(); - si != objectSources.end(); ++si) { - std::string obj = ogt->ObjectDirectory; - obj += ogt->Objects[*si]; - objs.push_back(obj); - } - } -} - void cmGeneratorTarget::GetAutoUicOptions(std::vector<std::string>& result, const std::string& config) const { @@ -3245,6 +3274,46 @@ std::string cmGeneratorTarget::GetPDBName(const std::string& config) const return prefix + base + ".pdb"; } +std::string cmGeneratorTarget::GetObjectDirectory( + std::string const& config) const +{ + std::string obj_dir = + this->GlobalGenerator->ExpandCFGIntDir(this->ObjectDirectory, config); +#if defined(__APPLE__) + // find and replace $(PROJECT_NAME) xcode placeholder + const std::string projectName = this->LocalGenerator->GetProjectName(); + cmSystemTools::ReplaceString(obj_dir, "$(PROJECT_NAME)", projectName); +#endif + return obj_dir; +} + +void cmGeneratorTarget::GetTargetObjectNames( + std::string const& config, std::vector<std::string>& objects) const +{ + std::vector<cmSourceFile const*> objectSources; + this->GetObjectSources(objectSources, config); + std::map<cmSourceFile const*, std::string> mapping; + + for (std::vector<cmSourceFile const*>::const_iterator it = + objectSources.begin(); + it != objectSources.end(); ++it) { + mapping[*it]; + } + + this->LocalGenerator->ComputeObjectFilenames(mapping, this); + + for (std::vector<cmSourceFile const*>::const_iterator it = + objectSources.begin(); + it != objectSources.end(); ++it) { + // Find the object file name corresponding to this source file. + std::map<cmSourceFile const*, std::string>::const_iterator map_it = + mapping.find(*it); + // It must exist because we populated the mapping just above. + assert(!map_it->second.empty()); + objects.push_back(map_it->second); + } +} + bool cmGeneratorTarget::StrictTargetComparison::operator()( cmGeneratorTarget const* t1, cmGeneratorTarget const* t2) const { @@ -4941,11 +5010,11 @@ bool cmGeneratorTarget::GetConfigCommonSourceFiles( std::vector<std::string>::const_iterator it = configs.begin(); const std::string& firstConfig = *it; - this->GetSourceFiles(files, firstConfig); + this->GetSourceFilesWithoutObjectLibraries(files, firstConfig); for (; it != configs.end(); ++it) { std::vector<cmSourceFile*> configFiles; - this->GetSourceFiles(configFiles, *it); + this->GetSourceFilesWithoutObjectLibraries(configFiles, *it); if (configFiles != files) { std::string firstConfigFiles; const char* sep = ""; diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 00df14b..5b903de 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -3,7 +3,7 @@ #ifndef cmGeneratorTarget_h #define cmGeneratorTarget_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmLinkItem.h" #include "cmListFileCache.h" @@ -12,6 +12,7 @@ #include <map> #include <set> +#include <stddef.h> #include <string> #include <utility> #include <vector> @@ -69,6 +70,8 @@ public: bool GetPropertyAsBool(const std::string& prop) const; void GetSourceFiles(std::vector<cmSourceFile*>& files, const std::string& config) const; + void GetSourceFilesWithoutObjectLibraries(std::vector<cmSourceFile*>& files, + const std::string& config) const; /** Source file kinds (classifications). Generators use this to decide how to treat a source file. */ @@ -107,6 +110,17 @@ public: /** Get all sources needed for a configuration with kinds assigned. */ KindedSources const& GetKindedSources(std::string const& config) const; + struct AllConfigSource + { + cmSourceFile const* Source; + cmGeneratorTarget::SourceKind Kind; + std::vector<size_t> Configs; + }; + + /** Get all sources needed for all configurations with kinds and + per-source configurations assigned. */ + std::vector<AllConfigSource> const& GetAllConfigSources() const; + void GetObjectSources(std::vector<cmSourceFile const*>&, const std::string& config) const; const std::string& GetObjectName(cmSourceFile const* file); @@ -118,8 +132,6 @@ public: const std::string& config) const; void GetResxSources(std::vector<cmSourceFile const*>&, const std::string& config) const; - void GetIDLSources(std::vector<cmSourceFile const*>&, - const std::string& config) const; void GetExternalObjects(std::vector<cmSourceFile const*>&, const std::string& config) const; void GetHeaderSources(std::vector<cmSourceFile const*>&, @@ -197,6 +209,11 @@ public: bool realname) const; std::string NormalGetRealName(const std::string& config) const; + /** Get the names of an object library's object files underneath + its object file directory. */ + void GetTargetObjectNames(std::string const& config, + std::vector<std::string>& objects) const; + /** What hierarchy level should the reported directory contain */ enum BundleDirectoryLevel { @@ -340,6 +357,9 @@ public: std::string GetFullNameImported(const std::string& config, bool implib) const; + /** Get source files common to all configurations and diagnose cases + with per-config sources. Excludes sources added by a TARGET_OBJECTS + generator expression. */ bool GetConfigCommonSourceFiles(std::vector<cmSourceFile*>& files) const; bool HaveBuildTreeRPATH(const std::string& config) const; @@ -349,8 +369,9 @@ public: time config name placeholder if needed for the generator. */ std::string ObjectDirectory; - void UseObjectLibraries(std::vector<std::string>& objs, - const std::string& config) const; + /** Full path with trailing slash to the top-level directory + holding object files for the given configuration. */ + std::string GetObjectDirectory(std::string const& config) const; void GetAppleArchs(const std::string& config, std::vector<std::string>& archVec) const; @@ -522,7 +543,7 @@ public: std::string GetPDBDirectory(const std::string& config) const; ///! Return the preferred linker language for this target - std::string GetLinkerLanguage(const std::string& config = "") const; + std::string GetLinkerLanguage(const std::string& config) const; /** Does this target have a GNU implib to convert to MS format? */ bool HasImplibGNUtoMS() const; @@ -736,6 +757,9 @@ private: void ComputeKindedSources(KindedSources& files, std::string const& config) const; + mutable std::vector<AllConfigSource> AllConfigSources; + void ComputeAllConfigSources() const; + std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries; std::vector<TargetPropertyEntry*> CompileOptionsEntries; std::vector<TargetPropertyEntry*> CompileFeaturesEntries; diff --git a/Source/cmGetCMakePropertyCommand.h b/Source/cmGetCMakePropertyCommand.h index 41a51a4..c454e34 100644 --- a/Source/cmGetCMakePropertyCommand.h +++ b/Source/cmGetCMakePropertyCommand.h @@ -3,7 +3,8 @@ #ifndef cmGetCMakePropertyCommand_h #define cmGetCMakePropertyCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmGetDirectoryPropertyCommand.h b/Source/cmGetDirectoryPropertyCommand.h index 1ae3125..0adf818 100644 --- a/Source/cmGetDirectoryPropertyCommand.h +++ b/Source/cmGetDirectoryPropertyCommand.h @@ -3,7 +3,8 @@ #ifndef cmGetDirectoryPropertyCommand_h #define cmGetDirectoryPropertyCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h index c0ad903..efc9d7b 100644 --- a/Source/cmGetFilenameComponentCommand.h +++ b/Source/cmGetFilenameComponentCommand.h @@ -3,7 +3,8 @@ #ifndef cmGetFilenameComponentCommand_h #define cmGetFilenameComponentCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmGetPropertyCommand.h b/Source/cmGetPropertyCommand.h index f9a33ac..a57c675 100644 --- a/Source/cmGetPropertyCommand.h +++ b/Source/cmGetPropertyCommand.h @@ -3,7 +3,8 @@ #ifndef cmGetPropertyCommand_h #define cmGetPropertyCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmGetSourceFilePropertyCommand.h b/Source/cmGetSourceFilePropertyCommand.h index 0f71851..558e2ab 100644 --- a/Source/cmGetSourceFilePropertyCommand.h +++ b/Source/cmGetSourceFilePropertyCommand.h @@ -3,7 +3,8 @@ #ifndef cmGetSourceFilePropertyCommand_h #define cmGetSourceFilePropertyCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmGetTargetPropertyCommand.h b/Source/cmGetTargetPropertyCommand.h index 32fe803..9cebb3b 100644 --- a/Source/cmGetTargetPropertyCommand.h +++ b/Source/cmGetTargetPropertyCommand.h @@ -3,7 +3,8 @@ #ifndef cmGetTargetPropertyCommand_h #define cmGetTargetPropertyCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmGetTestPropertyCommand.h b/Source/cmGetTestPropertyCommand.h index 0491cc8..d3d10cb 100644 --- a/Source/cmGetTestPropertyCommand.h +++ b/Source/cmGetTestPropertyCommand.h @@ -3,7 +3,8 @@ #ifndef cmGetTestPropertyCommand_h #define cmGetTestPropertyCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmGhsMultiGpj.h b/Source/cmGhsMultiGpj.h index 2c2b123..7bc7bfc 100644 --- a/Source/cmGhsMultiGpj.h +++ b/Source/cmGhsMultiGpj.h @@ -3,7 +3,7 @@ #ifndef cmGhsMultiGpj_h #define cmGhsMultiGpj_h -#include <cmConfigure.h> +#include "cmConfigure.h" class cmGeneratedFileStream; diff --git a/Source/cmGlobalCommonGenerator.h b/Source/cmGlobalCommonGenerator.h index e8e6ad9..f2ad059 100644 --- a/Source/cmGlobalCommonGenerator.h +++ b/Source/cmGlobalCommonGenerator.h @@ -3,7 +3,7 @@ #ifndef cmGlobalCommonGenerator_h #define cmGlobalCommonGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmGlobalGenerator.h" diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index ce83e2e..50ad1a8 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2,10 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalGenerator.h" +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" #include <algorithm> #include <assert.h> -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> #include <iterator> #include <sstream> #include <stdio.h> @@ -44,8 +44,8 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmCryptoHash.h" -#include <cm_jsoncpp_value.h> -#include <cm_jsoncpp_writer.h> +#include "cm_jsoncpp_value.h" +#include "cm_jsoncpp_writer.h" #endif #if defined(_MSC_VER) && _MSC_VER >= 1800 @@ -1347,10 +1347,11 @@ void cmGlobalGenerator::Generate() for (std::map<std::string, cmExportBuildFileGenerator*>::iterator it = this->BuildExportSets.begin(); it != this->BuildExportSets.end(); ++it) { - if (!it->second->GenerateImportFile() && - !cmSystemTools::GetErrorOccuredFlag()) { - this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, - "Could not write export file."); + if (!it->second->GenerateImportFile()) { + if (!cmSystemTools::GetErrorOccuredFlag()) { + this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, + "Could not write export file."); + } return; } } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index b228d41..aa2dd22 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -3,7 +3,7 @@ #ifndef cmGlobalGenerator_h #define cmGlobalGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <map> @@ -331,6 +331,11 @@ public: i.e. "Can I build Debug and Release in the same tree?" */ virtual bool IsMultiConfig() const { return false; } + /** Return true if we know the exact location of object files. + If false, store the reason in the given string. + This is meaningful only after EnableLanguage has been called. */ + virtual bool HasKnownObjectFileLocation(std::string*) const { return true; } + virtual bool UseFolderProperty() const; virtual bool IsIPOSupported() const { return false; } diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 5e948f7..d5a6db0 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -3,7 +3,7 @@ #ifndef cmGlobalGeneratorFactory_h #define cmGlobalGeneratorFactory_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> #include <vector> diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 286f375..42ab4d9 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalGhsMultiGenerator.h" -#include <cmsys/SystemTools.hxx> +#include "cmsys/SystemTools.hxx" #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index 75209c3..a958a17 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -14,8 +14,8 @@ #include "cmXMLWriter.h" #include "cmake.h" -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" #include <map> #include <set> #include <string.h> diff --git a/Source/cmGlobalKdevelopGenerator.h b/Source/cmGlobalKdevelopGenerator.h index 8121fa8..bdcf8a1 100644 --- a/Source/cmGlobalKdevelopGenerator.h +++ b/Source/cmGlobalKdevelopGenerator.h @@ -3,7 +3,7 @@ #ifndef cmGlobalKdevelopGenerator_h #define cmGlobalKdevelopGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmExternalMakefileProjectGenerator.h" diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx index 7e0d0d4..3f22382 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.cxx +++ b/Source/cmGlobalMSYSMakefileGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalMSYSMakefileGenerator.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 1bdef53..aae01ca 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2,11 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalNinjaGenerator.h" +#include "cm_jsoncpp_reader.h" +#include "cm_jsoncpp_value.h" +#include "cm_jsoncpp_writer.h" +#include "cmsys/FStream.hxx" #include <algorithm> -#include <cm_jsoncpp_reader.h> -#include <cm_jsoncpp_value.h> -#include <cm_jsoncpp_writer.h> -#include <cmsys/FStream.hxx> #include <ctype.h> #include <functional> #include <iterator> diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 956af51..e06afb0 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -3,7 +3,7 @@ #ifndef cmGlobalNinjaGenerator_h #define cmGlobalNinjaGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <map> diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index bbf9f0f..a656102 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -3,7 +3,7 @@ #ifndef cmGlobalUnixMakefileGenerator3_h #define cmGlobalUnixMakefileGenerator3_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <map> diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index ca98e6c..ee9e47a 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -23,9 +23,9 @@ #include "cmXMLWriter.h" #include "cmake.h" -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/RegularExpression.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" +#include "cmsys/RegularExpression.hxx" #include <algorithm> diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index ae99408..b4b327d 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -3,7 +3,7 @@ #ifndef cmGlobalVisualStudio11Generator_h #define cmGlobalVisualStudio11Generator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <set> diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h index 3453628..ebc95bb 100644 --- a/Source/cmGlobalVisualStudio12Generator.h +++ b/Source/cmGlobalVisualStudio12Generator.h @@ -3,7 +3,7 @@ #ifndef cmGlobalVisualStudio12Generator_h #define cmGlobalVisualStudio12Generator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <string> diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index d2ac36b..df086d3 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -217,24 +217,44 @@ struct NoWindowsH std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion() { #if defined(_WIN32) && !defined(__CYGWIN__) - // This logic is taken from the vcvarsqueryregistry.bat file from VS2015 - // Try HKLM and then HKCU. - std::string win10Root; - if (!cmSystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" - "Windows Kits\\Installed Roots;KitsRoot10", - win10Root, cmSystemTools::KeyWOW64_32) && - !cmSystemTools::ReadRegistryValue( - "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\" - "Windows Kits\\Installed Roots;KitsRoot10", - win10Root, cmSystemTools::KeyWOW64_32)) { + std::vector<std::string> win10Roots; + + { + std::string win10Root; + if (cmSystemTools::GetEnv("CMAKE_WINDOWS_KITS_10_DIR", win10Root)) { + cmSystemTools::ConvertToUnixSlashes(win10Root); + win10Roots.push_back(win10Root); + } + } + + { + // This logic is taken from the vcvarsqueryregistry.bat file from VS2015 + // Try HKLM and then HKCU. + std::string win10Root; + if (cmSystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "Windows Kits\\Installed Roots;KitsRoot10", + win10Root, cmSystemTools::KeyWOW64_32) || + cmSystemTools::ReadRegistryValue( + "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\" + "Windows Kits\\Installed Roots;KitsRoot10", + win10Root, cmSystemTools::KeyWOW64_32)) { + cmSystemTools::ConvertToUnixSlashes(win10Root); + win10Roots.push_back(win10Root); + } + } + + if (win10Roots.empty()) { return std::string(); } std::vector<std::string> sdks; - std::string path = win10Root + "Include/*"; // Grab the paths of the different SDKs that are installed - cmSystemTools::GlobDirs(path, sdks); + for (std::vector<std::string>::iterator i = win10Roots.begin(); + i != win10Roots.end(); ++i) { + std::string path = *i + "/Include/*"; + cmSystemTools::GlobDirs(path, sdks); + } // Skip SDKs that do not contain <um/windows.h> because that indicates that // only the UCRT MSIs were installed for them. diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h index ab22978..0ce9a56 100644 --- a/Source/cmGlobalVisualStudio14Generator.h +++ b/Source/cmGlobalVisualStudio14Generator.h @@ -3,7 +3,7 @@ #ifndef cmGlobalVisualStudio14Generator_h #define cmGlobalVisualStudio14Generator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <string> diff --git a/Source/cmGlobalVisualStudio15Generator.h b/Source/cmGlobalVisualStudio15Generator.h index f979b65..4be88f4 100644 --- a/Source/cmGlobalVisualStudio15Generator.h +++ b/Source/cmGlobalVisualStudio15Generator.h @@ -3,7 +3,7 @@ #ifndef cmGlobalVisualStudio15Generator_h #define cmGlobalVisualStudio15Generator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <string> diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 3f8d381..aeceb8d 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -13,58 +13,6 @@ cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator( : cmGlobalVisualStudio7Generator(cm, platformName) { this->ProjectConfigurationSectionName = "ProjectConfiguration"; - this->Version = VS71; -} - -std::string cmGlobalVisualStudio71Generator::GetUserMacrosDirectory() -{ - // Macros not supported on Visual Studio 7.1 and earlier because - // they do not appear to work *during* a build when called by an - // outside agent... - // - return ""; - -#if 0 - // - // The COM result from calling a Visual Studio macro with 7.1 indicates - // that the call succeeds, but the macro does not appear to execute... - // - // So, I am leaving this code here to show how to do it, but have not - // yet figured out what the issue is in terms of why the macro does not - // appear to execute... - // - std::string base; - std::string path; - - // base begins with the VisualStudioProjectsLocation reg value... - if (cmSystemTools::ReadRegistryValue( - "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\7.1;" - "VisualStudioProjectsLocation", - base)) - { - cmSystemTools::ConvertToUnixSlashes(base); - - // 7.1 macros folder: - path = base + "/VSMacros71"; - } - - // path is (correctly) still empty if we did not read the base value from - // the Registry value - return path; -#endif -} - -std::string cmGlobalVisualStudio71Generator::GetUserMacrosRegKeyBase() -{ - // Macros not supported on Visual Studio 7.1 and earlier because - // they do not appear to work *during* a build when called by an - // outside agent... - // - return ""; - -#if 0 - return "Software\\Microsoft\\VisualStudio\\7.1\\vsmacros"; -#endif } void cmGlobalVisualStudio71Generator::WriteSLNFile( @@ -91,11 +39,6 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile( std::ostringstream targetsSlnString; this->WriteTargetsToSolution(targetsSlnString, root, orderedProjectTargets); - // VS 7 does not support folders specified first. - if (this->GetVersion() <= VS71) { - fout << targetsSlnString.str(); - } - // Generate folder specification. bool useFolderProperty = this->UseFolderProperty(); if (useFolderProperty) { @@ -103,9 +46,7 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile( } // Now write the actual target specification content. - if (this->GetVersion() > VS71) { - fout << targetsSlnString.str(); - } + fout << targetsSlnString.str(); // Write out the configurations information for the solution fout << "Global\n"; @@ -280,10 +221,3 @@ void cmGlobalVisualStudio71Generator::WriteSLNHeader(std::ostream& fout) { fout << "Microsoft Visual Studio Solution File, Format Version 8.00\n"; } - -void cmGlobalVisualStudio71Generator::GetDocumentation( - cmDocumentationEntry& entry) -{ - entry.Name = cmGlobalVisualStudio71Generator::GetActualName(); - entry.Brief = "Deprecated. Generates Visual Studio .NET 2003 project files."; -} diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index c65a84a..0ce02aa 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -15,37 +15,8 @@ class cmGlobalVisualStudio71Generator : public cmGlobalVisualStudio7Generator public: cmGlobalVisualStudio71Generator(cmake* cm, const std::string& platformName = ""); - static cmGlobalGeneratorFactory* NewFactory() - { - return new cmGlobalGeneratorSimpleFactory< - cmGlobalVisualStudio71Generator>(); - } - - ///! Get the name for the generator. - virtual std::string GetName() const - { - return cmGlobalVisualStudio71Generator::GetActualName(); - } - static std::string GetActualName() { return "Visual Studio 7 .NET 2003"; } - - /** Get the documentation entry for this generator. */ - static void GetDocumentation(cmDocumentationEntry& entry); - - /** - * Where does this version of Visual Studio look for macros for the - * current user? Returns the empty string if this version of Visual - * Studio does not implement support for VB macros. - */ - virtual std::string GetUserMacrosDirectory(); - - /** - * What is the reg key path to "vsmacros" for this version of Visual - * Studio? - */ - virtual std::string GetUserMacrosRegKeyBase(); protected: - virtual const char* GetIDEVersion() { return "7.1"; } virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); virtual void WriteSolutionConfigurations( diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 2d0abf9..14ec72f 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -9,7 +9,7 @@ #include "cmState.h" #include "cmUuid.h" #include "cmake.h" -#include <cmsys/Encoding.hxx> +#include "cmsys/Encoding.hxx" #include <assert.h> #include <windows.h> @@ -54,7 +54,6 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator( this->DefaultPlatformName = platformName; } this->ExtraFlagTable = cmVS7ExtraFlagTable; - this->Version = VS7; } cmGlobalVisualStudio7Generator::~cmGlobalVisualStudio7Generator() @@ -294,19 +293,6 @@ void cmGlobalVisualStudio7Generator::Generate() if (!cmSystemTools::GetErrorOccuredFlag()) { this->CallVisualStudioMacro(MacroReload); } - - if (this->Version == VS71 && !this->CMakeInstance->GetIsInTryCompile()) { - const char* cmakeWarnVS71 = - this->CMakeInstance->GetState()->GetCacheEntryValue("CMAKE_WARN_VS71"); - if (!cmakeWarnVS71 || !cmSystemTools::IsOff(cmakeWarnVS71)) { - this->CMakeInstance->IssueMessage( - cmake::WARNING, - "The \"Visual Studio 7 .NET 2003\" generator is deprecated " - "and will be removed in a future version of CMake." - "\n" - "Add CMAKE_WARN_VS71=OFF to the cache to disable this warning."); - } - } } void cmGlobalVisualStudio7Generator::OutputSLNFile( diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 634db7f..1fcb5ac 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -153,13 +153,6 @@ void cmGlobalVisualStudio8Generator::WriteSLNHeader(std::ostream& fout) fout << "# Visual Studio 2005\n"; } -void cmGlobalVisualStudio8Generator::GetDocumentation( - cmDocumentationEntry& entry) -{ - entry.Name = cmGlobalVisualStudio8Generator::GetActualName(); - entry.Brief = "Generates Visual Studio 8 2005 project files."; -} - std::string cmGlobalVisualStudio8Generator::GetGenerateStampList() { return "generate.stamp.list"; diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 03fa077..4723b83 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -20,9 +20,6 @@ public: ///! Get the name for the generator. virtual std::string GetName() const { return this->Name; } - /** Get the documentation entry for this generator. */ - static void GetDocumentation(cmDocumentationEntry& entry); - /** Get the name of the main stamp list file. */ static std::string GetGenerateStampList(); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index eae1dc4..87a22d1 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -3,7 +3,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalVisualStudioGenerator.h" -#include <cmsys/Encoding.hxx> +#include "cmsys/Encoding.hxx" #include <iostream> #include <windows.h> diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index f32f0bb..c12a933 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -3,7 +3,7 @@ #ifndef cmGlobalVisualStudioGenerator_h #define cmGlobalVisualStudioGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <map> @@ -32,8 +32,6 @@ public: /** Known versions of Visual Studio. */ enum VSVersion { - VS7 = 70, - VS71 = 71, VS8 = 80, VS9 = 90, VS10 = 100, diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index 1c290f8..b2d6d5d 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h @@ -3,7 +3,7 @@ #ifndef cmGlobalWatcomWMakeGenerator_h #define cmGlobalWatcomWMakeGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmGlobalGeneratorFactory.h" #include "cmGlobalUnixMakefileGenerator3.h" diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index febe95d..8c1c0e7 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalXCodeGenerator.h" +#include "cmsys/RegularExpression.hxx" #include <assert.h> -#include <cmsys/RegularExpression.hxx> #include <iomanip> #include <sstream> #include <stdio.h> @@ -152,6 +152,9 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(cmake* cm, this->CurrentLocalGenerator = 0; this->XcodeBuildCommandInitialized = false; + this->ObjectDirArchDefault = "$(CURRENT_ARCH)"; + this->ComputeObjectDirArch(); + cm->GetState()->SetIsGeneratorMultiConfig(true); } @@ -282,13 +285,7 @@ void cmGlobalXCodeGenerator::EnableLanguage( } mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); this->cmGlobalGenerator::EnableLanguage(lang, mf, optional); - const char* osxArch = mf->GetDefinition("CMAKE_OSX_ARCHITECTURES"); - const char* sysroot = mf->GetDefinition("CMAKE_OSX_SYSROOT"); - if (osxArch && sysroot) { - this->Architectures.clear(); - cmSystemTools::ExpandListArgument(std::string(osxArch), - this->Architectures); - } + this->ComputeArchitectures(mf); } void cmGlobalXCodeGenerator::GenerateBuildCommand( @@ -654,11 +651,6 @@ std::string GetGroupMapKeyFromPath(cmGeneratorTarget* target, return key; } -std::string GetGroupMapKey(cmGeneratorTarget* target, cmSourceFile* sf) -{ - return GetGroupMapKeyFromPath(target, sf->GetFullPath()); -} - cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFileFromPath( const std::string& fullpath, cmGeneratorTarget* target, const std::string& lang, cmSourceFile* sf) @@ -1054,11 +1046,14 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets( // Add object library contents as external objects. (Equivalent to // the externalObjFiles above, except each one is not a cmSourceFile // within the target.) - std::vector<std::string> objs; - gtgt->UseObjectLibraries(objs, ""); - for (std::vector<std::string>::const_iterator oi = objs.begin(); + std::vector<cmSourceFile const*> objs; + gtgt->GetExternalObjects(objs, ""); + for (std::vector<cmSourceFile const*>::const_iterator oi = objs.begin(); oi != objs.end(); ++oi) { - std::string obj = *oi; + if ((*oi)->GetObjectLibrary().empty()) { + continue; + } + std::string const& obj = (*oi)->GetFullPath(); cmXCodeObject* xsf = this->CreateXCodeSourceFileFromPath(obj, gtgt, "", 0); externalObjFiles.push_back(xsf); @@ -2672,13 +2667,16 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) // Add object library contents as link flags. std::string linkObjs; const char* sep = ""; - std::vector<std::string> objs; - gt->UseObjectLibraries(objs, ""); - for (std::vector<std::string>::const_iterator oi = objs.begin(); + std::vector<cmSourceFile const*> objs; + gt->GetExternalObjects(objs, configName); + for (std::vector<cmSourceFile const*>::const_iterator oi = objs.begin(); oi != objs.end(); ++oi) { + if ((*oi)->GetObjectLibrary().empty()) { + continue; + } linkObjs += sep; sep = " "; - linkObjs += this->XCodeEscapePath(*oi); + linkObjs += this->XCodeEscapePath((*oi)->GetFullPath()); } this->AppendBuildSettingAttribute( target, this->GetTargetLinkFlagsVar(gt), linkObjs.c_str(), configName); @@ -2785,32 +2783,23 @@ bool cmGlobalXCodeGenerator::CreateGroups( gtgt->AddSource(plist); } - std::vector<cmSourceFile*> classes; - if (!gtgt->GetConfigCommonSourceFiles(classes)) { - return false; - } + std::vector<cmGeneratorTarget::AllConfigSource> const& sources = + gtgt->GetAllConfigSources(); + // Put cmSourceFile instances in proper groups: - for (std::vector<cmSourceFile*>::const_iterator s = classes.begin(); - s != classes.end(); s++) { - cmSourceFile* sf = *s; + for (std::vector<cmGeneratorTarget::AllConfigSource>::const_iterator si = + sources.begin(); + si != sources.end(); ++si) { + cmSourceFile const* sf = si->Source; + if (this->XcodeVersion >= 50 && !sf->GetObjectLibrary().empty()) { + // Object library files go on the link line instead. + continue; + } // Add the file to the list of sources. std::string const& source = sf->GetFullPath(); cmSourceGroup* sourceGroup = mf->FindSourceGroup(source.c_str(), sourceGroups); cmXCodeObject* pbxgroup = this->CreateOrGetPBXGroup(gtgt, sourceGroup); - std::string key = GetGroupMapKey(gtgt, sf); - this->GroupMap[key] = pbxgroup; - } - - // Put OBJECT_LIBRARY objects in proper groups: - std::vector<std::string> objs; - gtgt->UseObjectLibraries(objs, ""); - for (std::vector<std::string>::const_iterator oi = objs.begin(); - oi != objs.end(); ++oi) { - std::string const& source = *oi; - cmSourceGroup* sourceGroup = - mf->FindSourceGroup(source.c_str(), sourceGroups); - cmXCodeObject* pbxgroup = this->CreateOrGetPBXGroup(gtgt, sourceGroup); std::string key = GetGroupMapKeyFromPath(gtgt, source); this->GroupMap[key] = pbxgroup; } @@ -3089,23 +3078,16 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( this->CreateString(defaultConfigName)); cmXCodeObject* buildSettings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); - const char* osxArch = - this->CurrentMakefile->GetDefinition("CMAKE_OSX_ARCHITECTURES"); const char* sysroot = this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT"); const char* deploymentTarget = this->CurrentMakefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); - std::string archs; if (sysroot) { - if (osxArch) { - // recompute this as it may have been changed since enable language - this->Architectures.clear(); - cmSystemTools::ExpandListArgument(std::string(osxArch), - this->Architectures); - archs = cmJoin(this->Architectures, " "); - } buildSettings->AddAttribute("SDKROOT", this->CreateString(sysroot)); } + // recompute this as it may have been changed since enable language + this->ComputeArchitectures(this->CurrentMakefile); + std::string const archs = cmJoin(this->Architectures, " "); if (archs.empty()) { // Tell Xcode to use NATIVE_ARCH instead of ARCHS. buildSettings->AddAttribute("ONLY_ACTIVE_ARCH", this->CreateString("YES")); @@ -3212,6 +3194,48 @@ std::string cmGlobalXCodeGenerator::GetObjectsNormalDirectory( return dir; } +void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf) +{ + this->Architectures.clear(); + const char* osxArch = mf->GetDefinition("CMAKE_OSX_ARCHITECTURES"); + const char* sysroot = mf->GetDefinition("CMAKE_OSX_SYSROOT"); + if (osxArch && sysroot) { + cmSystemTools::ExpandListArgument(std::string(osxArch), + this->Architectures); + } + + if (this->Architectures.empty()) { + // With no ARCHS we use ONLY_ACTIVE_ARCH. + // Look up the arch that Xcode chooses in this case. + if (const char* arch = mf->GetDefinition("CMAKE_XCODE_CURRENT_ARCH")) { + this->ObjectDirArchDefault = arch; + } + } + + this->ComputeObjectDirArch(); +} + +void cmGlobalXCodeGenerator::ComputeObjectDirArch() +{ + if (this->XcodeVersion >= 21) { + if (this->Architectures.size() > 1) { + this->ObjectDirArch = "$(CURRENT_ARCH)"; + } else if (!this->Architectures.empty()) { + this->ObjectDirArch = this->Architectures[0]; + } else { + this->ObjectDirArch = this->ObjectDirArchDefault; + } + } else { +#if defined(__ppc__) + this->ObjectDirArch = "ppc"; +#elif defined(__i386) + this->ObjectDirArch = "i386"; +#else + this->ObjectDirArch = ""; +#endif + } +} + void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( std::vector<cmXCodeObject*>& targets) { @@ -3696,6 +3720,18 @@ bool cmGlobalXCodeGenerator::IsMultiConfig() const return true; } +bool cmGlobalXCodeGenerator::HasKnownObjectFileLocation( + std::string* reason) const +{ + if (this->ObjectDirArch.find('$') != std::string::npos) { + if (reason != CM_NULLPTR) { + *reason = " under Xcode with multiple architectures"; + } + return false; + } + return true; +} + bool cmGlobalXCodeGenerator::UseEffectivePlatformName(cmMakefile* mf) const { const char* epnValue = @@ -3721,15 +3757,7 @@ void cmGlobalXCodeGenerator::ComputeTargetObjectDirectory( std::string configName = this->GetCMakeCFGIntDir(); std::string dir = this->GetObjectsNormalDirectory("$(PROJECT_NAME)", configName, gt); - if (this->XcodeVersion >= 21) { - dir += "$(CURRENT_ARCH)/"; - } else { -#ifdef __ppc__ - dir += "ppc/"; -#endif -#ifdef __i386 - dir += "i386/"; -#endif - } + dir += this->ObjectDirArch; + dir += "/"; gt->ObjectDirectory = dir; } diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 172e414..a733d5c 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -3,7 +3,8 @@ #ifndef cmGlobalXCodeGenerator_h #define cmGlobalXCodeGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <iosfwd> #include <map> #include <set> @@ -86,6 +87,8 @@ public: i.e. "Can I build Debug and Release in the same tree?" */ bool IsMultiConfig() const CM_OVERRIDE; + bool HasKnownObjectFileLocation(std::string* reason) const CM_OVERRIDE; + bool UseEffectivePlatformName(cmMakefile* mf) const CM_OVERRIDE; bool ShouldStripResourcePath(cmMakefile*) const CM_OVERRIDE; @@ -240,6 +243,9 @@ private: const std::string& configName, const cmGeneratorTarget* t) const; + void ComputeArchitectures(cmMakefile* mf); + void ComputeObjectDirArch(); + void addObject(cmXCodeObject* obj); std::string PostBuildMakeTarget(std::string const& tName, std::string const& configName); @@ -261,6 +267,8 @@ private: std::map<std::string, cmXCodeObject*> FileRefs; std::map<cmGeneratorTarget const*, cmXCodeObject*> XCodeObjectMap; std::vector<std::string> Architectures; + std::string ObjectDirArchDefault; + std::string ObjectDirArch; std::string GeneratorToolset; }; diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h index e6aec47..527db16 100644 --- a/Source/cmGraphAdjacencyList.h +++ b/Source/cmGraphAdjacencyList.h @@ -3,7 +3,7 @@ #ifndef cmGraphAdjacencyList_h #define cmGraphAdjacencyList_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <vector> diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 0f69aaa..1fcd3cb 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGraphVizWriter.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iostream> #include <sstream> #include <utility> diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h index 1ff07ab..824999b 100644 --- a/Source/cmGraphVizWriter.h +++ b/Source/cmGraphVizWriter.h @@ -3,11 +3,11 @@ #ifndef CMGRAPHVIZWRITER_H #define CMGRAPHVIZWRITER_H -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmStateTypes.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <map> #include <set> #include <string> diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx index d9d6598..78dceb7 100644 --- a/Source/cmHexFileConverter.cxx +++ b/Source/cmHexFileConverter.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmHexFileConverter.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <stdio.h> #include <string.h> diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx index bda6b75..5e872d2 100644 --- a/Source/cmIDEOptions.cxx +++ b/Source/cmIDEOptions.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmIDEOptions.h" -#include <cmsys/String.h> +#include "cmsys/String.h" #include <iterator> #include <string.h> diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h index 11f8aba..19e96bd 100644 --- a/Source/cmIDEOptions.h +++ b/Source/cmIDEOptions.h @@ -3,7 +3,7 @@ #ifndef cmIDEOptions_h #define cmIDEOptions_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <map> #include <string> diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h index f81db67..59d32e6 100644 --- a/Source/cmIfCommand.h +++ b/Source/cmIfCommand.h @@ -3,7 +3,8 @@ #ifndef cmIfCommand_h #define cmIfCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmIncludeCommand.h b/Source/cmIncludeCommand.h index 78edd43..06200cd 100644 --- a/Source/cmIncludeCommand.h +++ b/Source/cmIncludeCommand.h @@ -3,7 +3,8 @@ #ifndef cmIncludeCommand_h #define cmIncludeCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h index 287b5d3..abe0c05 100644 --- a/Source/cmIncludeDirectoryCommand.h +++ b/Source/cmIncludeDirectoryCommand.h @@ -3,7 +3,8 @@ #ifndef cmIncludeDirectoryCommand_h #define cmIncludeDirectoryCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmIncludeExternalMSProjectCommand.h b/Source/cmIncludeExternalMSProjectCommand.h index 9fcf467..5274f9e 100644 --- a/Source/cmIncludeExternalMSProjectCommand.h +++ b/Source/cmIncludeExternalMSProjectCommand.h @@ -3,7 +3,8 @@ #ifndef cmIncludeExternalMSProjectCommand_h #define cmIncludeExternalMSProjectCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmIncludeRegularExpressionCommand.h b/Source/cmIncludeRegularExpressionCommand.h index c68d9f2..a003360 100644 --- a/Source/cmIncludeRegularExpressionCommand.h +++ b/Source/cmIncludeRegularExpressionCommand.h @@ -3,7 +3,8 @@ #ifndef cmIncludeRegularExpressionCommand_h #define cmIncludeRegularExpressionCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 4c331c7..ba554aa 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallCommand.h" -#include <cmsys/Glob.hxx> +#include "cmsys/Glob.hxx" #include <sstream> #include <stddef.h> @@ -206,6 +206,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) cmCAStringVector archiveArgVector(&argHelper, "ARCHIVE", &group); cmCAStringVector libraryArgVector(&argHelper, "LIBRARY", &group); cmCAStringVector runtimeArgVector(&argHelper, "RUNTIME", &group); + cmCAStringVector objectArgVector(&argHelper, "OBJECTS", &group); cmCAStringVector frameworkArgVector(&argHelper, "FRAMEWORK", &group); cmCAStringVector bundleArgVector(&argHelper, "BUNDLE", &group); cmCAStringVector includesArgVector(&argHelper, "INCLUDES", &group); @@ -234,6 +235,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) cmInstallCommandArguments archiveArgs(this->DefaultComponentName); cmInstallCommandArguments libraryArgs(this->DefaultComponentName); cmInstallCommandArguments runtimeArgs(this->DefaultComponentName); + cmInstallCommandArguments objectArgs(this->DefaultComponentName); cmInstallCommandArguments frameworkArgs(this->DefaultComponentName); cmInstallCommandArguments bundleArgs(this->DefaultComponentName); cmInstallCommandArguments privateHeaderArgs(this->DefaultComponentName); @@ -246,6 +248,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) archiveArgs.Parse(&archiveArgVector.GetVector(), &unknownArgs); libraryArgs.Parse(&libraryArgVector.GetVector(), &unknownArgs); runtimeArgs.Parse(&runtimeArgVector.GetVector(), &unknownArgs); + objectArgs.Parse(&objectArgVector.GetVector(), &unknownArgs); frameworkArgs.Parse(&frameworkArgVector.GetVector(), &unknownArgs); bundleArgs.Parse(&bundleArgVector.GetVector(), &unknownArgs); privateHeaderArgs.Parse(&privateHeaderArgVector.GetVector(), &unknownArgs); @@ -265,6 +268,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) archiveArgs.SetGenericArguments(&genericArgs); libraryArgs.SetGenericArguments(&genericArgs); runtimeArgs.SetGenericArguments(&genericArgs); + objectArgs.SetGenericArguments(&genericArgs); frameworkArgs.SetGenericArguments(&genericArgs); bundleArgs.SetGenericArguments(&genericArgs); privateHeaderArgs.SetGenericArguments(&genericArgs); @@ -274,6 +278,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) success = success && archiveArgs.Finalize(); success = success && libraryArgs.Finalize(); success = success && runtimeArgs.Finalize(); + success = success && objectArgs.Finalize(); success = success && frameworkArgs.Finalize(); success = success && bundleArgs.Finalize(); success = success && privateHeaderArgs.Finalize(); @@ -287,8 +292,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) // Enforce argument rules too complex to specify for the // general-purpose parser. if (archiveArgs.GetNamelinkOnly() || runtimeArgs.GetNamelinkOnly() || - frameworkArgs.GetNamelinkOnly() || bundleArgs.GetNamelinkOnly() || - privateHeaderArgs.GetNamelinkOnly() || + objectArgs.GetNamelinkOnly() || frameworkArgs.GetNamelinkOnly() || + bundleArgs.GetNamelinkOnly() || privateHeaderArgs.GetNamelinkOnly() || publicHeaderArgs.GetNamelinkOnly() || resourceArgs.GetNamelinkOnly()) { this->SetError( "TARGETS given NAMELINK_ONLY option not in LIBRARY group. " @@ -296,8 +301,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) return false; } if (archiveArgs.GetNamelinkSkip() || runtimeArgs.GetNamelinkSkip() || - frameworkArgs.GetNamelinkSkip() || bundleArgs.GetNamelinkSkip() || - privateHeaderArgs.GetNamelinkSkip() || + objectArgs.GetNamelinkSkip() || frameworkArgs.GetNamelinkSkip() || + bundleArgs.GetNamelinkSkip() || privateHeaderArgs.GetNamelinkSkip() || publicHeaderArgs.GetNamelinkSkip() || resourceArgs.GetNamelinkSkip()) { this->SetError( "TARGETS given NAMELINK_SKIP option not in LIBRARY group. " @@ -356,11 +361,15 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) return false; } if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) { - std::ostringstream e; - e << "TARGETS given OBJECT library \"" << (*targetIt) - << "\" which may not be installed."; - this->SetError(e.str()); - return false; + std::string reason; + if (!this->Makefile->GetGlobalGenerator()->HasKnownObjectFileLocation( + &reason)) { + std::ostringstream e; + e << "TARGETS given OBJECT library \"" << (*targetIt) + << "\" which may not be installed" << reason << "."; + this->SetError(e.str()); + return false; + } } // Store the target in the list to be installed. targets.push_back(target); @@ -379,6 +388,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) bool installsArchive = false; bool installsLibrary = false; bool installsRuntime = false; + bool installsObject = false; bool installsFramework = false; bool installsBundle = false; bool installsPrivateHeader = false; @@ -393,6 +403,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) cmInstallTargetGenerator* archiveGenerator = CM_NULLPTR; cmInstallTargetGenerator* libraryGenerator = CM_NULLPTR; cmInstallTargetGenerator* runtimeGenerator = CM_NULLPTR; + cmInstallTargetGenerator* objectGenerator = CM_NULLPTR; cmInstallTargetGenerator* frameworkGenerator = CM_NULLPTR; cmInstallTargetGenerator* bundleGenerator = CM_NULLPTR; cmInstallFilesGenerator* privateHeaderGenerator = CM_NULLPTR; @@ -522,6 +533,20 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) return false; } } break; + case cmStateEnums::OBJECT_LIBRARY: { + // Objects use OBJECT properties. + if (!objectArgs.GetDestination().empty()) { + objectGenerator = + CreateInstallTargetGenerator(target, objectArgs, false); + } else { + std::ostringstream e; + e << "TARGETS given no OBJECTS DESTINATION for object library " + "target \"" + << target.GetName() << "\"."; + this->SetError(e.str()); + return false; + } + } break; case cmStateEnums::EXECUTABLE: { if (target.IsAppBundleOnApple()) { // Application bundles use the BUNDLE properties. @@ -664,6 +689,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) installsArchive = installsArchive || archiveGenerator != CM_NULLPTR; installsLibrary = installsLibrary || libraryGenerator != CM_NULLPTR; installsRuntime = installsRuntime || runtimeGenerator != CM_NULLPTR; + installsObject = installsObject || objectGenerator != CM_NULLPTR; installsFramework = installsFramework || frameworkGenerator != CM_NULLPTR; installsBundle = installsBundle || bundleGenerator != CM_NULLPTR; installsPrivateHeader = @@ -675,6 +701,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) this->Makefile->AddInstallGenerator(archiveGenerator); this->Makefile->AddInstallGenerator(libraryGenerator); this->Makefile->AddInstallGenerator(runtimeGenerator); + this->Makefile->AddInstallGenerator(objectGenerator); this->Makefile->AddInstallGenerator(frameworkGenerator); this->Makefile->AddInstallGenerator(bundleGenerator); this->Makefile->AddInstallGenerator(privateHeaderGenerator); @@ -692,6 +719,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) te->HeaderGenerator = publicHeaderGenerator; te->LibraryGenerator = libraryGenerator; te->RuntimeGenerator = runtimeGenerator; + te->ObjectsGenerator = objectGenerator; this->Makefile->GetGlobalGenerator() ->GetExportSets()[exports.GetString()] ->AddTargetExport(te); @@ -715,6 +743,10 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) this->Makefile->GetGlobalGenerator()->AddInstallComponent( runtimeArgs.GetComponent().c_str()); } + if (installsObject) { + this->Makefile->GetGlobalGenerator()->AddInstallComponent( + objectArgs.GetComponent().c_str()); + } if (installsFramework) { this->Makefile->GetGlobalGenerator()->AddInstallComponent( frameworkArgs.GetComponent().c_str()); diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h index 187a6ce..fde629b 100644 --- a/Source/cmInstallCommand.h +++ b/Source/cmInstallCommand.h @@ -3,7 +3,8 @@ #ifndef cmInstallCommand_h #define cmInstallCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx index 6b15468..b73414d 100644 --- a/Source/cmInstallCommandArguments.cxx +++ b/Source/cmInstallCommandArguments.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallCommandArguments.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmSystemTools.h" diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h index c1523b2..a576e72 100644 --- a/Source/cmInstallCommandArguments.h +++ b/Source/cmInstallCommandArguments.h @@ -3,7 +3,7 @@ #ifndef cmInstallCommandArguments_h #define cmInstallCommandArguments_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmInstallDirectoryGenerator.h b/Source/cmInstallDirectoryGenerator.h index 0518092..029ce46 100644 --- a/Source/cmInstallDirectoryGenerator.h +++ b/Source/cmInstallDirectoryGenerator.h @@ -6,7 +6,8 @@ #include "cmInstallGenerator.h" #include "cmScriptGenerator.h" -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <iosfwd> #include <string> #include <vector> diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h index b0fe889..3a46a72 100644 --- a/Source/cmInstallExportGenerator.h +++ b/Source/cmInstallExportGenerator.h @@ -3,7 +3,7 @@ #ifndef cmInstallExportGenerator_h #define cmInstallExportGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmInstallGenerator.h" #include "cmScriptGenerator.h" diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h index c3e2919..588c289 100644 --- a/Source/cmInstallFilesCommand.h +++ b/Source/cmInstallFilesCommand.h @@ -3,7 +3,8 @@ #ifndef cmInstallFilesCommand_h #define cmInstallFilesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h index ca8c6e1..578763b 100644 --- a/Source/cmInstallFilesGenerator.h +++ b/Source/cmInstallFilesGenerator.h @@ -3,7 +3,7 @@ #ifndef cmInstallFilesGenerator_h #define cmInstallFilesGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmInstallGenerator.h" #include "cmScriptGenerator.h" diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h index 48e1644..bb1dd54 100644 --- a/Source/cmInstallGenerator.h +++ b/Source/cmInstallGenerator.h @@ -3,7 +3,7 @@ #ifndef cmInstallGenerator_h #define cmInstallGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmInstallType.h" #include "cmScriptGenerator.h" diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h index ca07a2f..2381d79 100644 --- a/Source/cmInstallProgramsCommand.h +++ b/Source/cmInstallProgramsCommand.h @@ -3,7 +3,8 @@ #ifndef cmInstallProgramsCommand_h #define cmInstallProgramsCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h index 0b54994..e183999 100644 --- a/Source/cmInstallScriptGenerator.h +++ b/Source/cmInstallScriptGenerator.h @@ -3,7 +3,7 @@ #ifndef cmInstallScriptGenerator_h #define cmInstallScriptGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmInstallGenerator.h" diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 88fcc56..6ecf42d 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -60,25 +60,6 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os) void cmInstallTargetGenerator::GenerateScriptForConfig( std::ostream& os, const std::string& config, Indent const& indent) { - // Compute the build tree directory from which to copy the target. - std::string fromDirConfig; - if (this->Target->NeedRelinkBeforeInstall(config)) { - fromDirConfig = - this->Target->GetLocalGenerator()->GetCurrentBinaryDirectory(); - fromDirConfig += cmake::GetCMakeFilesDirectory(); - fromDirConfig += "/CMakeRelink.dir/"; - } else { - fromDirConfig = this->Target->GetDirectory(config, this->ImportLibrary); - fromDirConfig += "/"; - } - std::string toDir = - this->ConvertToAbsoluteDestination(this->GetDestination(config)); - toDir += "/"; - - // Compute the list of files to install for this target. - std::vector<std::string> filesFrom; - std::vector<std::string> filesTo; - std::string literal_args; cmStateEnums::TargetType targetType = this->Target->GetType(); cmInstallType type = cmInstallType(); switch (targetType) { @@ -100,7 +81,11 @@ void cmInstallTargetGenerator::GenerateScriptForConfig( assert(false && "INTERFACE_LIBRARY targets have no installable outputs."); break; + case cmStateEnums::OBJECT_LIBRARY: + this->GenerateScriptForConfigObjectLibrary(os, config, indent); + return; + case cmStateEnums::UTILITY: case cmStateEnums::GLOBAL_TARGET: case cmStateEnums::UNKNOWN_LIBRARY: @@ -109,6 +94,28 @@ void cmInstallTargetGenerator::GenerateScriptForConfig( "cmInstallTargetGenerator created with non-installable target."); return; } + + // Compute the build tree directory from which to copy the target. + std::string fromDirConfig; + if (this->Target->NeedRelinkBeforeInstall(config)) { + fromDirConfig = + this->Target->GetLocalGenerator()->GetCurrentBinaryDirectory(); + fromDirConfig += cmake::GetCMakeFilesDirectory(); + fromDirConfig += "/CMakeRelink.dir/"; + } else { + fromDirConfig = this->Target->GetDirectory(config, this->ImportLibrary); + fromDirConfig += "/"; + } + + std::string toDir = + this->ConvertToAbsoluteDestination(this->GetDestination(config)); + toDir += "/"; + + // Compute the list of files to install for this target. + std::vector<std::string> filesFrom; + std::vector<std::string> filesTo; + std::string literal_args; + if (targetType == cmStateEnums::EXECUTABLE) { // There is a bug in cmInstallCommand if this fails. assert(this->NamelinkMode == NamelinkModeNone); @@ -315,6 +322,49 @@ void cmInstallTargetGenerator::GenerateScriptForConfig( &cmInstallTargetGenerator::PostReplacementTweaks); } +static std::string computeInstallObjectDir(cmGeneratorTarget* gt, + std::string const& config) +{ + std::string objectDir = "objects"; + if (!config.empty()) { + objectDir += "-"; + objectDir += config; + } + objectDir += "/"; + objectDir += gt->GetName(); + return objectDir; +} + +void cmInstallTargetGenerator::GenerateScriptForConfigObjectLibrary( + std::ostream& os, const std::string& config, Indent const& indent) +{ + // Compute all the object files inside this target + std::vector<std::string> objects; + this->Target->GetTargetObjectNames(config, objects); + + std::string const dest = this->GetDestination(config) + "/" + + computeInstallObjectDir(this->Target, config); + + std::string const obj_dir = this->Target->GetObjectDirectory(config); + std::string const literal_args = " FILES_FROM_DIR \"" + obj_dir + "\""; + + const char* no_dir_permissions = CM_NULLPTR; + const char* no_rename = CM_NULLPTR; + this->AddInstallRule(os, dest, cmInstallType_FILES, objects, this->Optional, + this->FilePermissions.c_str(), no_dir_permissions, + no_rename, literal_args.c_str(), indent); +} + +void cmInstallTargetGenerator::GetInstallObjectNames( + std::string const& config, std::vector<std::string>& objects) const +{ + this->Target->GetTargetObjectNames(config, objects); + for (std::vector<std::string>::iterator i = objects.begin(); + i != objects.end(); ++i) { + *i = computeInstallObjectDir(this->Target, config) + "/" + *i; + } +} + std::string cmInstallTargetGenerator::GetDestination( std::string const& config) const { diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index 084a033..6aaa3ba 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h @@ -3,7 +3,7 @@ #ifndef cmInstallTargetGenerator_h #define cmInstallTargetGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmInstallGenerator.h" #include "cmScriptGenerator.h" @@ -41,6 +41,9 @@ public: std::string GetInstallFilename(const std::string& config) const; + void GetInstallObjectNames(std::string const& config, + std::vector<std::string>& objects) const; + enum NameType { NameNormal, @@ -65,6 +68,9 @@ protected: void GenerateScript(std::ostream& os) CM_OVERRIDE; void GenerateScriptForConfig(std::ostream& os, const std::string& config, Indent const& indent) CM_OVERRIDE; + void GenerateScriptForConfigObjectLibrary(std::ostream& os, + const std::string& config, + Indent const& indent); typedef void (cmInstallTargetGenerator::*TweakMethod)(std::ostream&, Indent const&, const std::string&, diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h index 150397d..77f461a 100644 --- a/Source/cmInstallTargetsCommand.h +++ b/Source/cmInstallTargetsCommand.h @@ -3,7 +3,8 @@ #ifndef cmInstallTargetsCommand_h #define cmInstallTargetsCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx index 8dd42b6..d51fd8d 100644 --- a/Source/cmInstalledFile.cxx +++ b/Source/cmInstalledFile.cxx @@ -7,7 +7,7 @@ #include "cmMakefile.h" #include "cmSystemTools.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <utility> cmInstalledFile::cmInstalledFile() diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h index 387b3b9..334b1b8 100644 --- a/Source/cmLinkDirectoriesCommand.h +++ b/Source/cmLinkDirectoriesCommand.h @@ -3,7 +3,8 @@ #ifndef cmLinkDirectoriesCommand_h #define cmLinkDirectoriesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index 6fd6f50..ae300e6 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -3,7 +3,7 @@ #ifndef cmLinkItem_h #define cmLinkItem_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <algorithm> #include <map> diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h index 66d7ec4..430e5a8 100644 --- a/Source/cmLinkLibrariesCommand.h +++ b/Source/cmLinkLibrariesCommand.h @@ -3,7 +3,8 @@ #ifndef cmLinkLibrariesCommand_h #define cmLinkLibrariesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmLinkLineComputer.h b/Source/cmLinkLineComputer.h index 57a70bc..bf65347 100644 --- a/Source/cmLinkLineComputer.h +++ b/Source/cmLinkLineComputer.h @@ -4,7 +4,7 @@ #ifndef cmLinkLineComputer_h #define cmLinkLineComputer_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmLinkLineDeviceComputer.h b/Source/cmLinkLineDeviceComputer.h index f275a0d..a827b06 100644 --- a/Source/cmLinkLineDeviceComputer.h +++ b/Source/cmLinkLineDeviceComputer.h @@ -4,7 +4,7 @@ #ifndef cmLinkLineDeviceComputer_h #define cmLinkLineDeviceComputer_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index 4f95522..55592cb 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -3,7 +3,7 @@ #ifndef cmLinkedTree_h #define cmLinkedTree_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <assert.h> #include <iterator> diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 295ea28..0542c4f 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmListCommand.h" +#include "cmsys/RegularExpression.hxx" #include <algorithm> #include <assert.h> -#include <cmsys/RegularExpression.hxx> #include <iterator> #include <sstream> #include <stdio.h> diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h index e7413ca..8d4aeb1 100644 --- a/Source/cmListCommand.h +++ b/Source/cmListCommand.h @@ -3,7 +3,8 @@ #ifndef cmListCommand_h #define cmListCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 23b666e..16297f3 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -9,9 +9,9 @@ #include "cmSystemTools.h" #include "cmake.h" +#include "cmConfigure.h" #include <algorithm> #include <assert.h> -#include <cmConfigure.h> #include <sstream> struct cmListFileParser diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 1a30f29..bda4ea3 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -3,7 +3,7 @@ #ifndef cmListFileCache_h #define cmListFileCache_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> #include <string> diff --git a/Source/cmListFileLexer.c b/Source/cmListFileLexer.c index 44d0894..3dd3b85 100644 --- a/Source/cmListFileLexer.c +++ b/Source/cmListFileLexer.c @@ -558,7 +558,7 @@ Modify cmListFileLexer.c: /* IWYU pragma: no_forward_declare yyguts_t */ #ifdef WIN32 -#include <cmsys/Encoding.h> +#include "cmsys/Encoding.h" #endif /* Setup the proper cmListFileLexer_yylex declaration. */ diff --git a/Source/cmListFileLexer.in.l b/Source/cmListFileLexer.in.l index dd64923..5152dbf 100644 --- a/Source/cmListFileLexer.in.l +++ b/Source/cmListFileLexer.in.l @@ -21,7 +21,7 @@ Modify cmListFileLexer.c: /* IWYU pragma: no_forward_declare yyguts_t */ #ifdef WIN32 -#include <cmsys/Encoding.h> +#include "cmsys/Encoding.h" #endif /* Setup the proper cmListFileLexer_yylex declaration. */ diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index ea84877..00a30bf 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLoadCacheCommand.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include "cmMakefile.h" #include "cmStateTypes.h" diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h index 539c74e..8dee973 100644 --- a/Source/cmLoadCacheCommand.h +++ b/Source/cmLoadCacheCommand.h @@ -3,7 +3,8 @@ #ifndef cmLoadCacheCommand_h #define cmLoadCacheCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <set> #include <string> #include <vector> diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h index d16dfea..97a6bd7 100644 --- a/Source/cmLoadCommandCommand.h +++ b/Source/cmLoadCommandCommand.h @@ -3,7 +3,8 @@ #ifndef cmLoadCommandCommand_h #define cmLoadCommandCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmLocalCommonGenerator.h b/Source/cmLocalCommonGenerator.h index f83f371..3de29d7 100644 --- a/Source/cmLocalCommonGenerator.h +++ b/Source/cmLocalCommonGenerator.h @@ -3,7 +3,7 @@ #ifndef cmLocalCommonGenerator_h #define cmLocalCommonGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 9333ed7..93db192 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -30,9 +30,9 @@ #include "cmCryptoHash.h" #endif +#include "cmsys/RegularExpression.hxx" #include <algorithm> #include <assert.h> -#include <cmsys/RegularExpression.hxx> #include <iterator> #include <sstream> #include <stdio.h> diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 901ca35..3047257 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -3,9 +3,9 @@ #ifndef cmLocalGenerator_h #define cmLocalGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cm_kwiml.h> +#include "cm_kwiml.h" #include <iosfwd> #include <map> #include <set> diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 1080319..fda4578 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -3,7 +3,7 @@ #ifndef cmLocalNinjaGenerator_h #define cmLocalNinjaGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <map> diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 4388e75..3313127 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalUnixMakefileGenerator3.h" +#include "cmsys/FStream.hxx" +#include "cmsys/Terminal.h" #include <algorithm> -#include <cmsys/FStream.hxx> -#include <cmsys/Terminal.h> #include <functional> #include <sstream> #include <stdio.h> diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index c3ecda4..f64409c 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -3,7 +3,7 @@ #ifndef cmLocalUnixMakefileGenerator3_h #define cmLocalUnixMakefileGenerator3_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmDepends.h" #include "cmLocalCommonGenerator.h" diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index 0516bdf..85d4a73 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -8,7 +8,7 @@ #include "cmVisualStudio10TargetGenerator.h" #include "cmXMLParser.h" -#include <cm_expat.h> +#include "cm_expat.h" class cmVS10XMLParser : public cmXMLParser { diff --git a/Source/cmLocalVisualStudio10Generator.h b/Source/cmLocalVisualStudio10Generator.h index 1ed57ec..e57dd8f 100644 --- a/Source/cmLocalVisualStudio10Generator.h +++ b/Source/cmLocalVisualStudio10Generator.h @@ -3,7 +3,7 @@ #ifndef cmLocalVisualStudio10Generator_h #define cmLocalVisualStudio10Generator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 9e83c77..7535ef4 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -9,8 +9,8 @@ #include "cmSourceFile.h" #include "cmSystemTools.h" #include "cmXMLParser.h" +#include "cm_expat.h" #include "cmake.h" -#include <cm_expat.h> #include "cmComputeLinkInformation.h" #include "cmGeneratedFileStream.h" @@ -30,7 +30,7 @@ public: typedef cmComputeLinkInformation::ItemVector ItemVector; void OutputLibraries(std::ostream& fout, ItemVector const& libs); void OutputObjects(std::ostream& fout, cmGeneratorTarget* t, - const char* isep = 0); + std::string const& config, const char* isep = 0); private: cmLocalVisualStudio7Generator* LocalGenerator; @@ -898,8 +898,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( // end of <Tool Name=VCMIDLTool // Add manifest tool settings. - if (targetBuilds && - this->GetVersion() >= cmGlobalVisualStudioGenerator::VS8) { + if (targetBuilds) { const char* manifestTool = "VCManifestTool"; if (this->FortranProject) { manifestTool = "VFManifestTool"; @@ -1040,10 +1039,9 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; - if (this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 || - this->FortranProject) { + if (this->FortranProject) { std::ostringstream libdeps; - this->Internal->OutputObjects(libdeps, target); + this->Internal->OutputObjects(libdeps, target, configName); if (!libdeps.str().empty()) { fout << "\t\t\t\tAdditionalDependencies=\"" << libdeps.str() << "\"\n"; @@ -1094,9 +1092,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( // libraries which may be set by the user to something bad. fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()); - if (this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 || - this->FortranProject) { - this->Internal->OutputObjects(fout, target, " "); + if (this->FortranProject) { + this->Internal->OutputObjects(fout, target, configName, " "); } fout << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); @@ -1179,9 +1176,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( // libraries which may be set by the user to something bad. fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()); - if (this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 || - this->FortranProject) { - this->Internal->OutputObjects(fout, target, " "); + if (this->FortranProject) { + this->Internal->OutputObjects(fout, target, configName, " "); } fout << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); @@ -1300,21 +1296,20 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries( } void cmLocalVisualStudio7GeneratorInternals::OutputObjects( - std::ostream& fout, cmGeneratorTarget* gt, const char* isep) + std::ostream& fout, cmGeneratorTarget* gt, std::string const& configName, + const char* isep) { // VS < 8 does not support per-config source locations so we // list object library content on the link line instead. cmLocalVisualStudio7Generator* lg = this->LocalGenerator; std::string currentBinDir = lg->GetCurrentBinaryDirectory(); - std::vector<cmSourceFile*> sources; - if (!gt->GetConfigCommonSourceFiles(sources)) { - return; - } + std::vector<cmSourceFile const*> objs; + gt->GetExternalObjects(objs, configName); const char* sep = isep ? isep : ""; - for (std::vector<cmSourceFile*>::const_iterator i = sources.begin(); - i != sources.end(); i++) { + for (std::vector<cmSourceFile const*>::const_iterator i = objs.begin(); + i != objs.end(); ++i) { if (!(*i)->GetObjectLibrary().empty()) { std::string const& objFile = (*i)->GetFullPath(); std::string rel = lg->ConvertToRelativePath(currentBinDir, objFile); @@ -1369,27 +1364,26 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, // We may be modifying the source groups temporarily, so make a copy. std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups(); - // get the classes from the source lists then add them to the groups - std::vector<cmSourceFile*> classes; - if (!target->GetConfigCommonSourceFiles(classes)) { - return; - } - for (std::vector<cmSourceFile*>::const_iterator i = classes.begin(); - i != classes.end(); i++) { - if (!(*i)->GetObjectLibrary().empty()) { - if (this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 || - this->FortranProject) { - // VS < 8 does not support per-config source locations so we - // list object library content on the link line instead. + std::vector<cmGeneratorTarget::AllConfigSource> const& sources = + target->GetAllConfigSources(); + std::map<cmSourceFile const*, size_t> sourcesIndex; + + for (size_t si = 0; si < sources.size(); ++si) { + cmSourceFile const* sf = sources[si].Source; + sourcesIndex[sf] = si; + if (!sf->GetObjectLibrary().empty()) { + if (this->FortranProject) { + // Intel Fortran does not support per-config source locations + // so we list object library content on the link line instead. // See OutputObjects. continue; } } // Add the file to the list of sources. - std::string source = (*i)->GetFullPath(); + std::string const source = sf->GetFullPath(); cmSourceGroup* sourceGroup = this->Makefile->FindSourceGroup(source.c_str(), sourceGroups); - sourceGroup->AssignSource(*i); + sourceGroup->AssignSource(sf); } // open the project @@ -1402,7 +1396,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, // Loop through every source group. for (unsigned int i = 0; i < sourceGroups.size(); ++i) { cmSourceGroup sg = sourceGroups[i]; - this->WriteGroup(&sg, target, fout, libName, configs); + this->WriteGroup(&sg, target, fout, libName, configs, sourcesIndex); } fout << "\t</Files>\n"; @@ -1424,25 +1418,28 @@ struct cmLVS7GFileConfig class cmLocalVisualStudio7GeneratorFCInfo { public: - cmLocalVisualStudio7GeneratorFCInfo(cmLocalVisualStudio7Generator* lg, - cmGeneratorTarget* target, - cmSourceFile const& sf, - std::vector<std::string> const& configs); + cmLocalVisualStudio7GeneratorFCInfo( + cmLocalVisualStudio7Generator* lg, cmGeneratorTarget* target, + cmGeneratorTarget::AllConfigSource const& acs, + std::vector<std::string> const& configs); std::map<std::string, cmLVS7GFileConfig> FileConfigMap; }; cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( cmLocalVisualStudio7Generator* lg, cmGeneratorTarget* gt, - cmSourceFile const& sf, std::vector<std::string> const& configs) + cmGeneratorTarget::AllConfigSource const& acs, + std::vector<std::string> const& configs) { + cmSourceFile const& sf = *acs.Source; std::string objectName; if (gt->HasExplicitObjectName(&sf)) { objectName = gt->GetObjectName(&sf); } // Compute per-source, per-config information. + size_t ci = 0; for (std::vector<std::string>::const_iterator i = configs.begin(); - i != configs.end(); ++i) { + i != configs.end(); ++i, ++ci) { std::string configUpper = cmSystemTools::UpperCase(*i); cmLVS7GFileConfig fc; bool needfc = false; @@ -1508,7 +1505,9 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( } // If HEADER_FILE_ONLY is set, we must suppress this generation in // the project file - fc.ExcludedFromBuild = (sf.GetPropertyAsBool("HEADER_FILE_ONLY")); + fc.ExcludedFromBuild = sf.GetPropertyAsBool("HEADER_FILE_ONLY") || + std::find(acs.Configs.begin(), acs.Configs.end(), ci) == + acs.Configs.end(); if (fc.ExcludedFromBuild) { needfc = true; } @@ -1563,7 +1562,8 @@ std::string cmLocalVisualStudio7Generator::ComputeLongestObjectDirectory( bool cmLocalVisualStudio7Generator::WriteGroup( const cmSourceGroup* sg, cmGeneratorTarget* target, std::ostream& fout, - const std::string& libName, std::vector<std::string> const& configs) + const std::string& libName, std::vector<std::string> const& configs, + std::map<cmSourceFile const*, size_t> const& sourcesIndex) { cmGlobalVisualStudio7Generator* gg = static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); @@ -1574,7 +1574,8 @@ bool cmLocalVisualStudio7Generator::WriteGroup( bool hasChildrenWithSources = false; std::ostringstream tmpOut; for (unsigned int i = 0; i < children.size(); ++i) { - if (this->WriteGroup(&children[i], target, tmpOut, libName, configs)) { + if (this->WriteGroup(&children[i], target, tmpOut, libName, configs, + sourcesIndex)) { hasChildrenWithSources = true; } } @@ -1590,15 +1591,26 @@ bool cmLocalVisualStudio7Generator::WriteGroup( this->WriteVCProjBeginGroup(fout, name.c_str(), ""); } + std::vector<cmGeneratorTarget::AllConfigSource> const& sources = + target->GetAllConfigSources(); + // Loop through each source in the source group. for (std::vector<const cmSourceFile*>::const_iterator sf = sourceFiles.begin(); sf != sourceFiles.end(); ++sf) { std::string source = (*sf)->GetFullPath(); - FCInfo fcinfo(this, target, *(*sf), configs); if (source != libName || target->GetType() == cmStateEnums::UTILITY || target->GetType() == cmStateEnums::GLOBAL_TARGET) { + // Look up the source kind and configs. + std::map<cmSourceFile const*, size_t>::const_iterator map_it = + sourcesIndex.find(*sf); + // The map entry must exist because we populated it earlier. + assert(map_it != sourcesIndex.end()); + cmGeneratorTarget::AllConfigSource const& acs = sources[map_it->second]; + + FCInfo fcinfo(this, target, acs, configs); + fout << "\t\t\t<File\n"; std::string d = this->ConvertToXMLOutputPathSingle(source.c_str()); // Tell MS-Dev what the source is. If the compiler knows how to @@ -1638,6 +1650,9 @@ bool cmLocalVisualStudio7Generator::WriteGroup( lang == "ASM_MASM") { aCompilerTool = "MASM"; } + if (acs.Kind == cmGeneratorTarget::SourceKindExternalObject) { + aCompilerTool = "VCCustomBuildTool"; + } for (std::map<std::string, cmLVS7GFileConfig>::const_iterator fci = fcinfo.FileConfigMap.begin(); fci != fcinfo.FileConfigMap.end(); ++fci) { @@ -1942,11 +1957,7 @@ void cmLocalVisualStudio7Generator::WriteProjectStart( << "<VisualStudioProject\n" << "\tProjectType=\"Visual C++\"\n"; /* clang-format on */ - if (gg->GetVersion() == cmGlobalVisualStudioGenerator::VS71) { - fout << "\tVersion=\"7.10\"\n"; - } else { - fout << "\tVersion=\"" << (gg->GetVersion() / 10) << ".00\"\n"; - } + fout << "\tVersion=\"" << (gg->GetVersion() / 10) << ".00\"\n"; const char* projLabel = target->GetProperty("PROJECT_LABEL"); if (!projLabel) { projLabel = libName.c_str(); @@ -1956,9 +1967,7 @@ void cmLocalVisualStudio7Generator::WriteProjectStart( keyword = "Win32Proj"; } fout << "\tName=\"" << projLabel << "\"\n"; - if (gg->GetVersion() >= cmGlobalVisualStudioGenerator::VS8) { - fout << "\tProjectGUID=\"{" << gg->GetGUID(libName.c_str()) << "}\"\n"; - } + fout << "\tProjectGUID=\"{" << gg->GetGUID(libName.c_str()) << "}\"\n"; this->WriteProjectSCC(fout, target); if (const char* targetFrameworkVersion = target->GetProperty("VS_DOTNET_TARGET_FRAMEWORK_VERSION")) { diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index ae6e2ed..89a3ee3 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -3,7 +3,7 @@ #ifndef cmLocalVisualStudio7Generator_h #define cmLocalVisualStudio7Generator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <string> @@ -119,7 +119,8 @@ private: bool WriteGroup(const cmSourceGroup* sg, cmGeneratorTarget* target, std::ostream& fout, const std::string& libName, - std::vector<std::string> const& configs); + std::vector<std::string> const& configs, + std::map<cmSourceFile const*, size_t> const& sourcesIndex); friend class cmLocalVisualStudio7GeneratorFCInfo; friend class cmLocalVisualStudio7GeneratorInternals; diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h index 39188f9..85fb8a5 100644 --- a/Source/cmLocalVisualStudioGenerator.h +++ b/Source/cmLocalVisualStudioGenerator.h @@ -3,7 +3,7 @@ #ifndef cmLocalVisualStudioGenerator_h #define cmLocalVisualStudioGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <map> #include <memory> diff --git a/Source/cmLocalXCodeGenerator.h b/Source/cmLocalXCodeGenerator.h index b4a8c6c..4ca02a9 100644 --- a/Source/cmLocalXCodeGenerator.h +++ b/Source/cmLocalXCodeGenerator.h @@ -3,7 +3,8 @@ #ifndef cmLocalXCodeGenerator_h #define cmLocalXCodeGenerator_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep + #include <map> #include <string> diff --git a/Source/cmLocale.h b/Source/cmLocale.h index cca7cf5..b98009f 100644 --- a/Source/cmLocale.h +++ b/Source/cmLocale.h @@ -3,7 +3,7 @@ #ifndef cmLocale_h #define cmLocale_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <locale.h> #include <string> diff --git a/Source/cmMSVC60LinkLineComputer.h b/Source/cmMSVC60LinkLineComputer.h index 9a28dca..612658c 100644 --- a/Source/cmMSVC60LinkLineComputer.h +++ b/Source/cmMSVC60LinkLineComputer.h @@ -4,7 +4,7 @@ #ifndef cmMSVC60LinkLineComputer_h #define cmMSVC60LinkLineComputer_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx index 586e6c6..a4350f7 100644 --- a/Source/cmMachO.cxx +++ b/Source/cmMachO.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMachO.h" +#include "cmsys/FStream.hxx" #include <algorithm> -#include <cmsys/FStream.hxx> #include <stddef.h> #include <string> #include <vector> diff --git a/Source/cmMachO.h b/Source/cmMachO.h index 901f17a..42745cf 100644 --- a/Source/cmMachO.h +++ b/Source/cmMachO.h @@ -3,7 +3,7 @@ #ifndef cmMachO_h #define cmMachO_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <string> diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h index acb4233..f0020ff 100644 --- a/Source/cmMacroCommand.h +++ b/Source/cmMacroCommand.h @@ -3,7 +3,8 @@ #ifndef cmMacroCommand_h #define cmMacroCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h index d9cce6f..54f4ab3 100644 --- a/Source/cmMakeDirectoryCommand.h +++ b/Source/cmMakeDirectoryCommand.h @@ -3,7 +3,8 @@ #ifndef cmMakeDirectoryCommand_h #define cmMakeDirectoryCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 9c68ccf..4ed76c7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2,10 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefile.h" +#include "cmsys/FStream.hxx" +#include "cmsys/RegularExpression.hxx" #include <algorithm> #include <assert.h> -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> #include <ctype.h> #include <sstream> #include <stdlib.h> diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 03a22fd..7543a89 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -3,9 +3,9 @@ #ifndef cmMakefile_h #define cmMakefile_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <map> #include <set> #include <stack> diff --git a/Source/cmMakefileExecutableTargetGenerator.h b/Source/cmMakefileExecutableTargetGenerator.h index 598ac3d..01aa627 100644 --- a/Source/cmMakefileExecutableTargetGenerator.h +++ b/Source/cmMakefileExecutableTargetGenerator.h @@ -3,7 +3,7 @@ #ifndef cmMakefileExecutableTargetGenerator_h #define cmMakefileExecutableTargetGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> diff --git a/Source/cmMakefileLibraryTargetGenerator.h b/Source/cmMakefileLibraryTargetGenerator.h index 93ce902..da1d8b6 100644 --- a/Source/cmMakefileLibraryTargetGenerator.h +++ b/Source/cmMakefileLibraryTargetGenerator.h @@ -3,7 +3,7 @@ #ifndef cmMakefileLibraryTargetGenerator_h #define cmMakefileLibraryTargetGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmMakefileTargetGenerator.h" diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index 07b8005..32b1fee 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -3,7 +3,7 @@ #ifndef cmMakefileTargetGenerator_h #define cmMakefileTargetGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <map> diff --git a/Source/cmMakefileUtilityTargetGenerator.h b/Source/cmMakefileUtilityTargetGenerator.h index 332c04e..8df5dd4 100644 --- a/Source/cmMakefileUtilityTargetGenerator.h +++ b/Source/cmMakefileUtilityTargetGenerator.h @@ -3,7 +3,7 @@ #ifndef cmMakefileUtilityTargetGenerator_h #define cmMakefileUtilityTargetGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmMakefileTargetGenerator.h" diff --git a/Source/cmMarkAsAdvancedCommand.h b/Source/cmMarkAsAdvancedCommand.h index 26caa66..8c2f85b 100644 --- a/Source/cmMarkAsAdvancedCommand.h +++ b/Source/cmMarkAsAdvancedCommand.h @@ -3,7 +3,8 @@ #ifndef cmMarkAsAdvancedCommand_h #define cmMarkAsAdvancedCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmMathCommand.h b/Source/cmMathCommand.h index 9b49b21..496d836 100644 --- a/Source/cmMathCommand.h +++ b/Source/cmMathCommand.h @@ -3,7 +3,8 @@ #ifndef cmMathCommand_h #define cmMathCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h index a565635..ca83ed6 100644 --- a/Source/cmMessageCommand.h +++ b/Source/cmMessageCommand.h @@ -3,7 +3,8 @@ #ifndef cmMessageCommand_h #define cmMessageCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx index fe1c261..3ae5bc5 100644 --- a/Source/cmMessenger.cxx +++ b/Source/cmMessenger.cxx @@ -8,7 +8,7 @@ #include "cmSystemTools.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include <cmsys/SystemInformation.hxx> +#include "cmsys/SystemInformation.hxx" #endif #include <sstream> diff --git a/Source/cmMessenger.h b/Source/cmMessenger.h index 89f8efe..4aafbd4 100644 --- a/Source/cmMessenger.h +++ b/Source/cmMessenger.h @@ -3,7 +3,7 @@ #ifndef cmMessenger_h #define cmMessenger_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmListFileCache.h" #include "cmake.h" diff --git a/Source/cmNewLineStyle.h b/Source/cmNewLineStyle.h index b46414c..397cd2c 100644 --- a/Source/cmNewLineStyle.h +++ b/Source/cmNewLineStyle.h @@ -3,7 +3,7 @@ #ifndef cmNewLineStyle_h #define cmNewLineStyle_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmNinjaLinkLineComputer.h b/Source/cmNinjaLinkLineComputer.h index ff0771b..db6d4a8 100644 --- a/Source/cmNinjaLinkLineComputer.h +++ b/Source/cmNinjaLinkLineComputer.h @@ -4,7 +4,7 @@ #ifndef cmNinjaLinkLineComputer_h #define cmNinjaLinkLineComputer_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> diff --git a/Source/cmNinjaNormalTargetGenerator.h b/Source/cmNinjaNormalTargetGenerator.h index e5595ea..677b1c6 100644 --- a/Source/cmNinjaNormalTargetGenerator.h +++ b/Source/cmNinjaNormalTargetGenerator.h @@ -3,7 +3,7 @@ #ifndef cmNinjaNormalTargetGenerator_h #define cmNinjaNormalTargetGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmNinjaTargetGenerator.h" diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 2b16e19..b008158 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -2,10 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmNinjaTargetGenerator.h" +#include "cm_jsoncpp_value.h" +#include "cm_jsoncpp_writer.h" #include <algorithm> #include <assert.h> -#include <cm_jsoncpp_value.h> -#include <cm_jsoncpp_writer.h> #include <iterator> #include <map> #include <sstream> diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index 7aba66b..9ce8651 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -3,7 +3,7 @@ #ifndef cmNinjaTargetGenerator_h #define cmNinjaTargetGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCommonTargetGenerator.h" #include "cmGlobalNinjaGenerator.h" diff --git a/Source/cmNinjaTypes.h b/Source/cmNinjaTypes.h index 3fd536a..b4af70e 100644 --- a/Source/cmNinjaTypes.h +++ b/Source/cmNinjaTypes.h @@ -3,7 +3,7 @@ #ifndef cmNinjaTypes_h #define cmNinjaTypes_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/cmNinjaUtilityTargetGenerator.h b/Source/cmNinjaUtilityTargetGenerator.h index 897f432..9256e36 100644 --- a/Source/cmNinjaUtilityTargetGenerator.h +++ b/Source/cmNinjaUtilityTargetGenerator.h @@ -3,7 +3,7 @@ #ifndef cmNinjaUtilityTargetGenerator_h #define cmNinjaUtilityTargetGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmNinjaTargetGenerator.h" diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx index c9f6ceb..c09feef 100644 --- a/Source/cmOSXBundleGenerator.cxx +++ b/Source/cmOSXBundleGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmOSXBundleGenerator.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmGeneratorTarget.h" #include "cmLocalGenerator.h" diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h index 0a5a6c5..be7e932 100644 --- a/Source/cmOSXBundleGenerator.h +++ b/Source/cmOSXBundleGenerator.h @@ -3,7 +3,7 @@ #ifndef cmOSXBundleGenerator_h #define cmOSXBundleGenerator_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <set> #include <string> diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h index 09567ff..86fa41f 100644 --- a/Source/cmOptionCommand.h +++ b/Source/cmOptionCommand.h @@ -3,7 +3,8 @@ #ifndef cmOptionCommand_h #define cmOptionCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h index d9e0126..3a0637a 100644 --- a/Source/cmOrderDirectories.h +++ b/Source/cmOrderDirectories.h @@ -3,9 +3,9 @@ #ifndef cmOrderDirectories_h #define cmOrderDirectories_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <map> #include <set> #include <string> diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index a3da4cd..12a1773 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -3,7 +3,7 @@ #ifndef cmOutputConverter_h #define cmOutputConverter_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index 3db0fec..8b8cf07 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmOutputRequiredFilesCommand.h" -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/RegularExpression.hxx" #include <map> #include <utility> diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h index c4ce680..e261eb0 100644 --- a/Source/cmOutputRequiredFilesCommand.h +++ b/Source/cmOutputRequiredFilesCommand.h @@ -3,7 +3,8 @@ #ifndef cmOutputRequiredFilesCommand_h #define cmOutputRequiredFilesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <set> #include <stdio.h> #include <string> diff --git a/Source/cmParseArgumentsCommand.h b/Source/cmParseArgumentsCommand.h index 079eadb..4d9416d 100644 --- a/Source/cmParseArgumentsCommand.h +++ b/Source/cmParseArgumentsCommand.h @@ -3,7 +3,8 @@ #ifndef cmParseArgumentsCommand_h #define cmParseArgumentsCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmPathLabel.h b/Source/cmPathLabel.h index cd9743c..97551fb 100644 --- a/Source/cmPathLabel.h +++ b/Source/cmPathLabel.h @@ -3,7 +3,7 @@ #ifndef cmPathLabel_h #define cmPathLabel_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 6339e11..837557b 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -8,8 +8,8 @@ #include "cmVersion.h" #include "cmake.h" +#include "cmConfigure.h" #include <assert.h> -#include <cmConfigure.h> #include <ctype.h> #include <sstream> #include <stdio.h> diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 72dcc4f..120beb6 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -3,7 +3,7 @@ #ifndef cmPolicies_h #define cmPolicies_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <bitset> #include <string> diff --git a/Source/cmProcessOutput.h b/Source/cmProcessOutput.h index d2e631f..b5ec4a8 100644 --- a/Source/cmProcessOutput.h +++ b/Source/cmProcessOutput.h @@ -3,7 +3,7 @@ #ifndef cmProcessOutput_h #define cmProcessOutput_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <stddef.h> #include <string> diff --git a/Source/cmProcessTools.cxx b/Source/cmProcessTools.cxx index b756650..de7b061 100644 --- a/Source/cmProcessTools.cxx +++ b/Source/cmProcessTools.cxx @@ -3,7 +3,7 @@ #include "cmProcessTools.h" #include "cmProcessOutput.h" -#include <cmsys/Process.h> +#include "cmsys/Process.h" #include <ostream> void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out, diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h index df131b9..e7d9a10 100644 --- a/Source/cmProcessTools.h +++ b/Source/cmProcessTools.h @@ -3,8 +3,8 @@ #ifndef cmProcessTools_h #define cmProcessTools_h +#include "cmConfigure.h" #include "cmProcessOutput.h" -#include <cmConfigure.h> #include <iosfwd> #include <string.h> diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 4e0fa57..d47a047 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmProjectCommand.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <sstream> #include <stdio.h> @@ -62,10 +62,13 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args, bool haveVersion = false; bool haveLanguages = false; + bool haveDescription = false; std::string version; + std::string description; std::vector<std::string> languages; enum Doing { + DoingDescription, DoingLanguages, DoingVersion }; @@ -89,9 +92,21 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args, } haveVersion = true; doing = DoingVersion; + } else if (args[i] == "DESCRIPTION") { + if (haveDescription) { + this->Makefile->IssueMessage( + cmake::FATAL_ERROR, "DESCRITPION may be specified at most once."); + cmSystemTools::SetFatalErrorOccured(); + return true; + } + haveDescription = true; + doing = DoingDescription; } else if (doing == DoingVersion) { doing = DoingLanguages; version = args[i]; + } else if (doing == DoingDescription) { + doing = DoingLanguages; + description = args[i]; } else // doing == DoingLanguages { languages.push_back(args[i]); @@ -197,6 +212,22 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args, } } + if (haveDescription) { + this->Makefile->AddDefinition("PROJECT_DESCRIPTION", description.c_str()); + // Set the CMAKE_PROJECT_DESCRIPTION variable to be the highest-level + // project name in the tree. If there are two project commands + // in the same CMakeLists.txt file, and it is the top level + // CMakeLists.txt file, then go with the last one. + if (!this->Makefile->GetDefinition("CMAKE_PROJECT_DESCRIPTION") || + (this->Makefile->IsRootMakefile())) { + this->Makefile->AddDefinition("CMAKE_PROJECT_DESCRIPTION", + description.c_str()); + this->Makefile->AddCacheDefinition( + "CMAKE_PROJECT_DESCRIPTION", description.c_str(), + "Value Computed by CMake", cmStateEnums::STATIC); + } + } + if (languages.empty()) { // if no language is specified do c and c++ languages.push_back("C"); diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h index cd92176..8fc90d2 100644 --- a/Source/cmProjectCommand.h +++ b/Source/cmProjectCommand.h @@ -3,7 +3,8 @@ #ifndef cmProjectCommand_h #define cmProjectCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmProperty.cxx b/Source/cmProperty.cxx index 90122a4..222afb4 100644 --- a/Source/cmProperty.cxx +++ b/Source/cmProperty.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmProperty.h" -#include <cmConfigure.h> +#include "cmConfigure.h" void cmProperty::Set(const char* value) { diff --git a/Source/cmProperty.h b/Source/cmProperty.h index 3f2dcfe..d11c5ef 100644 --- a/Source/cmProperty.h +++ b/Source/cmProperty.h @@ -3,7 +3,7 @@ #ifndef cmProperty_h #define cmProperty_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmPropertyDefinition.h b/Source/cmPropertyDefinition.h index eb8d064..9adff49 100644 --- a/Source/cmPropertyDefinition.h +++ b/Source/cmPropertyDefinition.h @@ -3,7 +3,7 @@ #ifndef cmPropertyDefinition_h #define cmPropertyDefinition_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmProperty.h" diff --git a/Source/cmPropertyDefinitionMap.h b/Source/cmPropertyDefinitionMap.h index e747503..97ba553 100644 --- a/Source/cmPropertyDefinitionMap.h +++ b/Source/cmPropertyDefinitionMap.h @@ -3,7 +3,7 @@ #ifndef cmPropertyDefinitionMap_h #define cmPropertyDefinitionMap_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmProperty.h" #include "cmPropertyDefinition.h" diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index fa92ae2..1e089d1 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmPropertyMap.h" +#include "cmConfigure.h" #include <algorithm> #include <assert.h> -#include <cmConfigure.h> #include <utility> cmProperty* cmPropertyMap::GetOrCreateProperty(const std::string& name) diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h index e1db7df..5a05150 100644 --- a/Source/cmPropertyMap.h +++ b/Source/cmPropertyMap.h @@ -3,7 +3,7 @@ #ifndef cmPropertyMap_h #define cmPropertyMap_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmProperty.h" diff --git a/Source/cmQTWrapCPPCommand.h b/Source/cmQTWrapCPPCommand.h index 8eb5ff9..34adf29 100644 --- a/Source/cmQTWrapCPPCommand.h +++ b/Source/cmQTWrapCPPCommand.h @@ -3,7 +3,8 @@ #ifndef cmQTWrapCPPCommand_h #define cmQTWrapCPPCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmQTWrapUICommand.h b/Source/cmQTWrapUICommand.h index 876ddd5..279d4e9 100644 --- a/Source/cmQTWrapUICommand.h +++ b/Source/cmQTWrapUICommand.h @@ -3,7 +3,8 @@ #ifndef cmQTWrapUICommand_h #define cmQTWrapUICommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmQtAutoGeneratorCommon.cxx b/Source/cmQtAutoGeneratorCommon.cxx index 2498fe8..1807514 100644 --- a/Source/cmQtAutoGeneratorCommon.cxx +++ b/Source/cmQtAutoGeneratorCommon.cxx @@ -4,8 +4,8 @@ #include "cmAlgorithms.h" #include "cmSystemTools.h" -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/RegularExpression.hxx" #include <sstream> #include <stddef.h> diff --git a/Source/cmQtAutoGeneratorCommon.h b/Source/cmQtAutoGeneratorCommon.h index b004005..a131baf 100644 --- a/Source/cmQtAutoGeneratorCommon.h +++ b/Source/cmQtAutoGeneratorCommon.h @@ -3,7 +3,8 @@ #ifndef cmQtAutoGeneratorCommon_h #define cmQtAutoGeneratorCommon_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index c7e02e6..239b18d 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -22,9 +22,9 @@ #include "cmGlobalVisualStudioGenerator.h" #endif +#include "cmConfigure.h" +#include "cmsys/FStream.hxx" #include <algorithm> -#include <cmConfigure.h> -#include <cmsys/FStream.hxx> #include <map> #include <set> #include <string> @@ -722,11 +722,11 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( if (gg->GetName().find("Visual Studio") != std::string::npos) { cmGlobalVisualStudioGenerator* vsgg = static_cast<cmGlobalVisualStudioGenerator*>(gg); - // Under VS >= 7 use a PRE_BUILD event instead of a separate target to + // Under VS use a PRE_BUILD event instead of a separate target to // reduce the number of targets loaded into the IDE. // This also works around a VS 11 bug that may skip updating the target: // https://connect.microsoft.com/VisualStudio/feedback/details/769495 - usePRE_BUILD = vsgg->GetVersion() >= cmGlobalVisualStudioGenerator::VS7; + usePRE_BUILD = true; } #endif diff --git a/Source/cmQtAutoGeneratorInitializer.h b/Source/cmQtAutoGeneratorInitializer.h index 26f2c8e..ca806f5 100644 --- a/Source/cmQtAutoGeneratorInitializer.h +++ b/Source/cmQtAutoGeneratorInitializer.h @@ -3,7 +3,7 @@ #ifndef cmQtAutoGeneratorInitializer_h #define cmQtAutoGeneratorInitializer_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep class cmGeneratorTarget; class cmLocalGenerator; diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 875062c..d142693 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -3,11 +3,11 @@ #include "cmQtAutoGenerators.h" #include "cmQtAutoGeneratorCommon.h" +#include "cmConfigure.h" +#include "cmsys/FStream.hxx" +#include "cmsys/Terminal.h" #include <algorithm> #include <assert.h> -#include <cmConfigure.h> -#include <cmsys/FStream.hxx> -#include <cmsys/Terminal.h> #include <list> #include <sstream> #include <stdlib.h> diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index cb6f45a..24c0a33 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -3,9 +3,10 @@ #ifndef cmQtAutoGenerators_h #define cmQtAutoGenerators_h -#include <cmConfigure.h> // IWYU pragma: keep -#include <cmFilePathChecksum.h> -#include <cmsys/RegularExpression.hxx> +#include "cmConfigure.h" // IWYU pragma: keep + +#include "cmFilePathChecksum.h" +#include "cmsys/RegularExpression.hxx" #include <map> #include <set> diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index 355b8c4..70ffc7d 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -6,8 +6,8 @@ #include "cmSystemTools.h" #include "cmVersion.h" +#include "cmsys/FStream.hxx" #include <algorithm> -#include <cmsys/FStream.hxx> #include <ctype.h> #include <iterator> #include <stddef.h> diff --git a/Source/cmRST.h b/Source/cmRST.h index 2fedf4b..d1a8e27 100644 --- a/Source/cmRST.h +++ b/Source/cmRST.h @@ -3,9 +3,9 @@ #ifndef _cmRST_h #define _cmRST_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <iosfwd> #include <map> #include <set> diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h index c935f28..38223a5 100644 --- a/Source/cmRemoveCommand.h +++ b/Source/cmRemoveCommand.h @@ -3,7 +3,8 @@ #ifndef cmRemoveCommand_h #define cmRemoveCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmRemoveDefinitionsCommand.h b/Source/cmRemoveDefinitionsCommand.h index 2bcc12d..2f6c924 100644 --- a/Source/cmRemoveDefinitionsCommand.h +++ b/Source/cmRemoveDefinitionsCommand.h @@ -3,7 +3,8 @@ #ifndef cmRemoveDefinitionsCommand_h #define cmRemoveDefinitionsCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmReturnCommand.h b/Source/cmReturnCommand.h index 9496d67..ceed6b5 100644 --- a/Source/cmReturnCommand.h +++ b/Source/cmReturnCommand.h @@ -3,7 +3,8 @@ #ifndef cmReturnCommand_h #define cmReturnCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h index 8329166..90b4119 100644 --- a/Source/cmRulePlaceholderExpander.h +++ b/Source/cmRulePlaceholderExpander.h @@ -4,7 +4,7 @@ #ifndef cmRulePlaceholderExpander_h #define cmRulePlaceholderExpander_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx index 4c5ab64..2a2dd40 100644 --- a/Source/cmScriptGenerator.cxx +++ b/Source/cmScriptGenerator.cxx @@ -4,7 +4,7 @@ #include "cmSystemTools.h" -#include <cmConfigure.h> +#include "cmConfigure.h" cmScriptGenerator::cmScriptGenerator( const std::string& config_var, diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h index a8f6fae..0e98b27 100644 --- a/Source/cmScriptGenerator.h +++ b/Source/cmScriptGenerator.h @@ -3,7 +3,7 @@ #ifndef cmScriptGenerator_h #define cmScriptGenerator_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <ostream> #include <string> diff --git a/Source/cmSearchPath.h b/Source/cmSearchPath.h index 9ffa871..932022a 100644 --- a/Source/cmSearchPath.h +++ b/Source/cmSearchPath.h @@ -3,7 +3,7 @@ #ifndef cmSearchPath_h #define cmSearchPath_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <set> #include <string> diff --git a/Source/cmSeparateArgumentsCommand.h b/Source/cmSeparateArgumentsCommand.h index 1cbf56e..7edde48 100644 --- a/Source/cmSeparateArgumentsCommand.h +++ b/Source/cmSeparateArgumentsCommand.h @@ -3,7 +3,8 @@ #ifndef cmSeparateArgumentsCommand_h #define cmSeparateArgumentsCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmServerConnection.h b/Source/cmServerConnection.h index 9357831..1fabe37 100644 --- a/Source/cmServerConnection.h +++ b/Source/cmServerConnection.h @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #pragma once -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h index 190092a..1c67bf9 100644 --- a/Source/cmSetCommand.h +++ b/Source/cmSetCommand.h @@ -3,7 +3,8 @@ #ifndef cmSetCommand_h #define cmSetCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmSetDirectoryPropertiesCommand.h b/Source/cmSetDirectoryPropertiesCommand.h index 854ad43..e04de6e 100644 --- a/Source/cmSetDirectoryPropertiesCommand.h +++ b/Source/cmSetDirectoryPropertiesCommand.h @@ -3,7 +3,8 @@ #ifndef cmSetDirectoryPropertiesCommand_h #define cmSetDirectoryPropertiesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h index fd7c922..3657f63 100644 --- a/Source/cmSetPropertyCommand.h +++ b/Source/cmSetPropertyCommand.h @@ -3,7 +3,8 @@ #ifndef cmSetsPropertiesCommand_h #define cmSetsPropertiesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <set> #include <string> #include <vector> diff --git a/Source/cmSetSourceFilesPropertiesCommand.h b/Source/cmSetSourceFilesPropertiesCommand.h index 8fa12c7..7dce437 100644 --- a/Source/cmSetSourceFilesPropertiesCommand.h +++ b/Source/cmSetSourceFilesPropertiesCommand.h @@ -3,7 +3,8 @@ #ifndef cmSetSourceFilesPropertiesCommand_h #define cmSetSourceFilesPropertiesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h index c3c0d06..bb34d1e 100644 --- a/Source/cmSetTargetPropertiesCommand.h +++ b/Source/cmSetTargetPropertiesCommand.h @@ -3,7 +3,8 @@ #ifndef cmSetTargetsPropertiesCommand_h #define cmSetTargetsPropertiesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmSetTestsPropertiesCommand.h b/Source/cmSetTestsPropertiesCommand.h index 45aed79..56a864f 100644 --- a/Source/cmSetTestsPropertiesCommand.h +++ b/Source/cmSetTestsPropertiesCommand.h @@ -3,7 +3,8 @@ #ifndef cmSetTestsPropertiesCommand_h #define cmSetTestsPropertiesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 4322a6d..7eace26 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSiteNameCommand.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include "cmMakefile.h" #include "cmStateTypes.h" diff --git a/Source/cmSiteNameCommand.h b/Source/cmSiteNameCommand.h index 01023b9..c7425f6 100644 --- a/Source/cmSiteNameCommand.h +++ b/Source/cmSiteNameCommand.h @@ -3,7 +3,8 @@ #ifndef cmSiteNameCommand_h #define cmSiteNameCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index bbcc300..0be659c 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -3,7 +3,7 @@ #ifndef cmSourceFile_h #define cmSourceFile_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmPropertyMap.h" #include "cmSourceFileLocation.h" diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index 4e0880e..86711d7 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSourceFileLocation.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmAlgorithms.h" #include "cmGlobalGenerator.h" diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h index aa2e6c7..6dbc2da 100644 --- a/Source/cmSourceFileLocation.h +++ b/Source/cmSourceFileLocation.h @@ -3,7 +3,7 @@ #ifndef cmSourceFileLocation_h #define cmSourceFileLocation_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h index 545da81..97affed 100644 --- a/Source/cmSourceGroup.h +++ b/Source/cmSourceGroup.h @@ -3,9 +3,9 @@ #ifndef cmSourceGroup_h #define cmSourceGroup_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <set> #include <string> #include <vector> diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h index 5549096..3086177 100644 --- a/Source/cmSourceGroupCommand.h +++ b/Source/cmSourceGroupCommand.h @@ -3,7 +3,8 @@ #ifndef cmSourceGroupCommand_h #define cmSourceGroupCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmStandardLexer.h b/Source/cmStandardLexer.h index b9adee5..c9f42e4 100644 --- a/Source/cmStandardLexer.h +++ b/Source/cmStandardLexer.h @@ -3,7 +3,7 @@ #ifndef cmStandardLexer_h #define cmStandardLexer_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep /* Disable some warnings. */ #if defined(_MSC_VER) @@ -50,7 +50,7 @@ #define YY_NO_UNPUT 1 #define ECHO -#include <cm_kwiml.h> +#include "cm_kwiml.h" typedef KWIML_INT_int8_t flex_int8_t; typedef KWIML_INT_uint8_t flex_uint8_t; typedef KWIML_INT_int16_t flex_int16_t; diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 0f49731..aca0358 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmState.h" +#include "cmsys/RegularExpression.hxx" #include <algorithm> #include <assert.h> -#include <cmsys/RegularExpression.hxx> #include <string.h> #include <utility> diff --git a/Source/cmState.h b/Source/cmState.h index 5659023..d2af5ce 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -3,7 +3,7 @@ #ifndef cmState_h #define cmState_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <set> diff --git a/Source/cmStateDirectory.h b/Source/cmStateDirectory.h index 8accc8e..79bb369 100644 --- a/Source/cmStateDirectory.h +++ b/Source/cmStateDirectory.h @@ -4,7 +4,7 @@ #ifndef cmStateDirectory_h #define cmStateDirectory_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmStatePrivate.h b/Source/cmStatePrivate.h index 20700f2..b2c6a7c 100644 --- a/Source/cmStatePrivate.h +++ b/Source/cmStatePrivate.h @@ -4,7 +4,7 @@ #ifndef cmStatePrivate_h #define cmStatePrivate_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h index 72d0349..2e82ef4 100644 --- a/Source/cmStateSnapshot.h +++ b/Source/cmStateSnapshot.h @@ -4,7 +4,7 @@ #ifndef cmStateSnapshot_h #define cmStateSnapshot_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmStateTypes.h b/Source/cmStateTypes.h index da14cdb..b2b12b4 100644 --- a/Source/cmStateTypes.h +++ b/Source/cmStateTypes.h @@ -4,7 +4,7 @@ #ifndef cmStateTypes_h #define cmStateTypes_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmLinkedTree.h" diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index eb94080..d6907e3 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmStringCommand.h" -#include <cmsys/RegularExpression.hxx> +#include "cmsys/RegularExpression.hxx" #include <ctype.h> #include <sstream> #include <stdio.h> diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index c63bc3f..89ecb12 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -3,7 +3,8 @@ #ifndef cmStringCommand_h #define cmStringCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h index ce1f876..ce2168d 100644 --- a/Source/cmSubdirCommand.h +++ b/Source/cmSubdirCommand.h @@ -3,7 +3,8 @@ #ifndef cmSubdirCommand_h #define cmSubdirCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h index 80ff24f..ae8fbaf 100644 --- a/Source/cmSubdirDependsCommand.h +++ b/Source/cmSubdirDependsCommand.h @@ -3,7 +3,8 @@ #ifndef cmSubdirDependsCommand_h #define cmSubdirDependsCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index ee751f2..7ace0a3 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -9,7 +9,7 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmArchiveWrite.h" #include "cmLocale.h" -#include <cm_libarchive.h> +#include "cm_libarchive.h" #ifndef __LA_INT64_T #define __LA_INT64_T la_int64_t #endif @@ -27,14 +27,14 @@ #include "cmMachO.h" #endif +#include "cmsys/Directory.hxx" +#include "cmsys/Encoding.hxx" +#include "cmsys/FStream.hxx" +#include "cmsys/RegularExpression.hxx" +#include "cmsys/System.h" +#include "cmsys/Terminal.h" #include <algorithm> #include <assert.h> -#include <cmsys/Directory.hxx> -#include <cmsys/Encoding.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> -#include <cmsys/System.h> -#include <cmsys/Terminal.h> #include <ctype.h> #include <errno.h> #include <iostream> @@ -617,8 +617,6 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command, while ((pipe = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) > 0) { // Translate NULL characters in the output into valid text. - // Visual Studio 7 puts these characters in the output of its - // build process. for (int i = 0; i < length; ++i) { if (data[i] == '\0') { data[i] = ' '; diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index e93eaae..86d92be 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -3,11 +3,11 @@ #ifndef cmSystemTools_h #define cmSystemTools_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep +#include "cmProcessOutput.h" +#include "cmsys/Process.h" #include "cmsys/SystemTools.hxx" // IWYU pragma: export -#include <cmProcessOutput.h> -#include <cmsys/Process.h> #include <stddef.h> #include <string> #include <vector> diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index e3c7b63..0b1bb06 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTarget.h" +#include "cmsys/RegularExpression.hxx" #include <algorithm> #include <assert.h> -#include <cmsys/RegularExpression.hxx> #include <map> #include <set> #include <sstream> @@ -291,13 +291,10 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, if (this->GetType() != cmStateEnums::UTILITY) { const char* configProps[] = { /* clang-format needs this comment to break after the opening brace */ - "ARCHIVE_OUTPUT_DIRECTORY_", - "LIBRARY_OUTPUT_DIRECTORY_", - "RUNTIME_OUTPUT_DIRECTORY_", - "PDB_OUTPUT_DIRECTORY_", - "COMPILE_PDB_OUTPUT_DIRECTORY_", - "MAP_IMPORTED_CONFIG_", - CM_NULLPTR + "ARCHIVE_OUTPUT_DIRECTORY_", "LIBRARY_OUTPUT_DIRECTORY_", + "RUNTIME_OUTPUT_DIRECTORY_", "PDB_OUTPUT_DIRECTORY_", + "COMPILE_PDB_OUTPUT_DIRECTORY_", "MAP_IMPORTED_CONFIG_", + "INTERPROCEDURAL_OPTIMIZATION_", CM_NULLPTR }; for (std::vector<std::string>::iterator ci = configNames.begin(); ci != configNames.end(); ++ci) { @@ -1354,11 +1351,9 @@ std::string cmTarget::ImportedGetFullPath(const std::string& config, // Lookup/compute/cache the import information for this // configuration. - std::string config_upper; - if (!config.empty()) { - config_upper = cmSystemTools::UpperCase(config); - } else { - config_upper = "NOCONFIG"; + std::string desired_config = config; + if (config.empty()) { + desired_config = "NOCONFIG"; } std::string result; @@ -1368,7 +1363,7 @@ std::string cmTarget::ImportedGetFullPath(const std::string& config, std::string suffix; if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && - this->GetMappedConfig(config_upper, &loc, &imp, suffix)) { + this->GetMappedConfig(desired_config, &loc, &imp, suffix)) { if (!pimplib) { if (loc) { result = loc; @@ -1451,18 +1446,28 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, const char** loc, const char** imp, std::string& suffix) const { - std::string const locPropBase = - this->GetType() == cmStateEnums::INTERFACE_LIBRARY ? "IMPORTED_LIBNAME" - : "IMPORTED_LOCATION"; + std::string config_upper; + if (!desired_config.empty()) { + config_upper = cmSystemTools::UpperCase(desired_config); + } + + std::string locPropBase; + if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { + locPropBase = "IMPORTED_LIBNAME"; + } else if (this->GetType() == cmStateEnums::OBJECT_LIBRARY) { + locPropBase = "IMPORTED_OBJECTS"; + } else { + locPropBase = "IMPORTED_LOCATION"; + } // Track the configuration-specific property suffix. suffix = "_"; - suffix += desired_config; + suffix += config_upper; std::vector<std::string> mappedConfigs; { std::string mapProp = "MAP_IMPORTED_CONFIG_"; - mapProp += desired_config; + mapProp += config_upper; if (const char* mapValue = this->GetProperty(mapProp)) { cmSystemTools::ExpandListArgument(mapValue, mappedConfigs, true); } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 1d40d20..c67143a 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -3,7 +3,7 @@ #ifndef cmTarget_h #define cmTarget_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> #include <map> diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h index caaf23b..663b9d0 100644 --- a/Source/cmTargetCompileDefinitionsCommand.h +++ b/Source/cmTargetCompileDefinitionsCommand.h @@ -3,7 +3,8 @@ #ifndef cmTargetCompileDefinitionsCommand_h #define cmTargetCompileDefinitionsCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmTargetCompileFeaturesCommand.h b/Source/cmTargetCompileFeaturesCommand.h index 01f2938..95214bf 100644 --- a/Source/cmTargetCompileFeaturesCommand.h +++ b/Source/cmTargetCompileFeaturesCommand.h @@ -3,7 +3,8 @@ #ifndef cmTargetCompileFeaturesCommand_h #define cmTargetCompileFeaturesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmTargetCompileOptionsCommand.h b/Source/cmTargetCompileOptionsCommand.h index 179013b..e4dfa75 100644 --- a/Source/cmTargetCompileOptionsCommand.h +++ b/Source/cmTargetCompileOptionsCommand.h @@ -3,7 +3,8 @@ #ifndef cmTargetCompileOptionsCommand_h #define cmTargetCompileOptionsCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h index a953efb..1839923 100644 --- a/Source/cmTargetDepend.h +++ b/Source/cmTargetDepend.h @@ -3,7 +3,7 @@ #ifndef cmTargetDepend_h #define cmTargetDepend_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <set> diff --git a/Source/cmTargetExport.h b/Source/cmTargetExport.h index b08ede2..9304eab 100644 --- a/Source/cmTargetExport.h +++ b/Source/cmTargetExport.h @@ -3,7 +3,7 @@ #ifndef cmTargetExport_h #define cmTargetExport_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> @@ -26,6 +26,7 @@ public: cmInstallTargetGenerator* ArchiveGenerator; cmInstallTargetGenerator* RuntimeGenerator; cmInstallTargetGenerator* LibraryGenerator; + cmInstallTargetGenerator* ObjectsGenerator; cmInstallTargetGenerator* FrameworkGenerator; cmInstallTargetGenerator* BundleGenerator; cmInstallFilesGenerator* HeaderGenerator; diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h index bc6cf0d..d6d33f2 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.h +++ b/Source/cmTargetIncludeDirectoriesCommand.h @@ -3,7 +3,8 @@ #ifndef cmTargetIncludeDirectoriesCommand_h #define cmTargetIncludeDirectoriesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h index 762b48f..bfa233e 100644 --- a/Source/cmTargetLinkLibrariesCommand.h +++ b/Source/cmTargetLinkLibrariesCommand.h @@ -3,7 +3,8 @@ #ifndef cmTargetLinkLibrariesCommand_h #define cmTargetLinkLibrariesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmTargetPropCommandBase.h b/Source/cmTargetPropCommandBase.h index 8b49653..46a2f6b 100644 --- a/Source/cmTargetPropCommandBase.h +++ b/Source/cmTargetPropCommandBase.h @@ -3,7 +3,7 @@ #ifndef cmTargetPropCommandBase_h #define cmTargetPropCommandBase_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmTargetPropertyComputer.h b/Source/cmTargetPropertyComputer.h index 45d31be..94688e3 100644 --- a/Source/cmTargetPropertyComputer.h +++ b/Source/cmTargetPropertyComputer.h @@ -3,7 +3,7 @@ #ifndef cmTargetPropertyComputer_h #define cmTargetPropertyComputer_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmTargetSourcesCommand.h b/Source/cmTargetSourcesCommand.h index b1afac2..6cc1abc 100644 --- a/Source/cmTargetSourcesCommand.h +++ b/Source/cmTargetSourcesCommand.h @@ -3,7 +3,8 @@ #ifndef cmTargetSourcesCommand_h #define cmTargetSourcesCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmTest.h b/Source/cmTest.h index 274a924..d4839d1 100644 --- a/Source/cmTest.h +++ b/Source/cmTest.h @@ -3,7 +3,7 @@ #ifndef cmTest_h #define cmTest_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmListFileCache.h" #include "cmPropertyMap.h" diff --git a/Source/cmTestGenerator.h b/Source/cmTestGenerator.h index b350806..7214375 100644 --- a/Source/cmTestGenerator.h +++ b/Source/cmTestGenerator.h @@ -3,7 +3,7 @@ #ifndef cmTestGenerator_h #define cmTestGenerator_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmScriptGenerator.h" diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index 3d42e26..4b97188 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTimestamp.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <cstring> #include <sstream> #include <stdlib.h> diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h index fdee564..8dd499a 100644 --- a/Source/cmTimestamp.h +++ b/Source/cmTimestamp.h @@ -3,7 +3,7 @@ #ifndef cmTimestamp_h #define cmTimestamp_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <time.h> diff --git a/Source/cmTryCompileCommand.h b/Source/cmTryCompileCommand.h index 52a0345..8972f7e 100644 --- a/Source/cmTryCompileCommand.h +++ b/Source/cmTryCompileCommand.h @@ -3,7 +3,8 @@ #ifndef cmTryCompileCommand_h #define cmTryCompileCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index c4fc94e..07e20e6 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTryRunCommand.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <stdio.h> #include <string.h> diff --git a/Source/cmTryRunCommand.h b/Source/cmTryRunCommand.h index 8b44ac5..b086dde 100644 --- a/Source/cmTryRunCommand.h +++ b/Source/cmTryRunCommand.h @@ -3,7 +3,8 @@ #ifndef cmTryRunCommand_h #define cmTryRunCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmUnexpectedCommand.h b/Source/cmUnexpectedCommand.h index 897dfb6..aee5d4d 100644 --- a/Source/cmUnexpectedCommand.h +++ b/Source/cmUnexpectedCommand.h @@ -3,7 +3,8 @@ #ifndef cmUnexpectedCommand_h #define cmUnexpectedCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmUnsetCommand.h b/Source/cmUnsetCommand.h index 5b07202..7e0f5b5 100644 --- a/Source/cmUnsetCommand.h +++ b/Source/cmUnsetCommand.h @@ -3,7 +3,8 @@ #ifndef cmUnsetCommand_h #define cmUnsetCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx index 8ef0958..07095b1 100644 --- a/Source/cmUseMangledMesaCommand.cxx +++ b/Source/cmUseMangledMesaCommand.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmUseMangledMesaCommand.h" -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/RegularExpression.hxx" #include "cmSystemTools.h" diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h index 9a49f94..e8bd8c6 100644 --- a/Source/cmUseMangledMesaCommand.h +++ b/Source/cmUseMangledMesaCommand.h @@ -3,7 +3,8 @@ #ifndef cmUseMangledMesaCommand_h #define cmUseMangledMesaCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h index 849b966..fa818bf 100644 --- a/Source/cmUtilitySourceCommand.h +++ b/Source/cmUtilitySourceCommand.h @@ -3,7 +3,8 @@ #ifndef cmUtilitySourceCommand_h #define cmUtilitySourceCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmUtils.hxx b/Source/cmUtils.hxx index 3f65872..c5c767c 100644 --- a/Source/cmUtils.hxx +++ b/Source/cmUtils.hxx @@ -3,7 +3,7 @@ #ifndef cmUtils_hxx #define cmUtils_hxx -#include <cmsys/SystemTools.hxx> +#include "cmsys/SystemTools.hxx" // Use the make system's VERBOSE environment variable to enable // verbose output. This can be skipped by also setting CMAKE_NO_VERBOSE diff --git a/Source/cmUuid.h b/Source/cmUuid.h index 1bc2229..158ce6e 100644 --- a/Source/cmUuid.h +++ b/Source/cmUuid.h @@ -3,7 +3,7 @@ #ifndef cmUuid_h #define cmUuid_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h index baf717c..6afb11a 100644 --- a/Source/cmVariableRequiresCommand.h +++ b/Source/cmVariableRequiresCommand.h @@ -3,7 +3,8 @@ #ifndef cmVariableRequiresCommand_h #define cmVariableRequiresCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx index c94ce17..419e1a4 100644 --- a/Source/cmVariableWatch.cxx +++ b/Source/cmVariableWatch.cxx @@ -4,8 +4,8 @@ #include "cmAlgorithms.h" +#include "cm_auto_ptr.hxx" #include <algorithm> -#include <cm_auto_ptr.hxx> #include <utility> static const char* const cmVariableWatchAccessStrings[] = { diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index 0b8b433..a575afe 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -3,7 +3,7 @@ #ifndef cmVariableWatch_h #define cmVariableWatch_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/cmVariableWatchCommand.h b/Source/cmVariableWatchCommand.h index 919bac4..7096ed5 100644 --- a/Source/cmVariableWatchCommand.h +++ b/Source/cmVariableWatchCommand.h @@ -3,7 +3,8 @@ #ifndef cmVariableWatchCommand_h #define cmVariableWatchCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <set> #include <string> #include <vector> diff --git a/Source/cmVersion.h b/Source/cmVersion.h index e77ec99..bfd994d 100644 --- a/Source/cmVersion.h +++ b/Source/cmVersion.h @@ -3,7 +3,7 @@ #ifndef cmVersion_h #define cmVersion_h -#include <cm_kwiml.h> +#include "cm_kwiml.h" /** \class cmVersion * \brief Helper class for providing CMake and CTest version information. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 419989a..f0f04a8 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -14,7 +14,7 @@ #include "cmVisualStudioGeneratorOptions.h" #include "windows.h" -#include <cm_auto_ptr.hxx> +#include "cm_auto_ptr.hxx" static std::string const kWINDOWS_7_1_SDK = "Windows7.1SDK"; @@ -1241,16 +1241,15 @@ void cmVisualStudio10TargetGenerator::WriteGroups() // collect up group information std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups(); - std::vector<cmSourceFile*> classes; - if (!this->GeneratorTarget->GetConfigCommonSourceFiles(classes)) { - return; - } + + std::vector<cmGeneratorTarget::AllConfigSource> const& sources = + this->GeneratorTarget->GetAllConfigSources(); std::set<cmSourceGroup*> groupsUsed; - for (std::vector<cmSourceFile*>::const_iterator s = classes.begin(); - s != classes.end(); s++) { - cmSourceFile* sf = *s; - std::string const& source = sf->GetFullPath(); + for (std::vector<cmGeneratorTarget::AllConfigSource>::const_iterator si = + sources.begin(); + si != sources.end(); ++si) { + std::string const& source = si->Source->GetFullPath(); cmSourceGroup* sourceGroup = this->Makefile->FindSourceGroup(source.c_str(), sourceGroups); groupsUsed.insert(sourceGroup); @@ -1727,15 +1726,6 @@ void cmVisualStudio10TargetGenerator::WriteSource(std::string const& tool, this->Tools[tool].push_back(toolSource); } -void cmVisualStudio10TargetGenerator::WriteSources( - std::string const& tool, std::vector<cmSourceFile const*> const& sources) -{ - for (std::vector<cmSourceFile const*>::const_iterator si = sources.begin(); - si != sources.end(); ++si) { - this->WriteSource(tool, *si); - } -} - void cmVisualStudio10TargetGenerator::WriteAllSources() { if (this->GeneratorTarget->GetType() > cmStateEnums::UTILITY) { @@ -1743,90 +1733,122 @@ void cmVisualStudio10TargetGenerator::WriteAllSources() } this->WriteString("<ItemGroup>\n", 1); - std::vector<cmSourceFile const*> headerSources; - this->GeneratorTarget->GetHeaderSources(headerSources, ""); - for (std::vector<cmSourceFile const*>::const_iterator si = - headerSources.begin(); - si != headerSources.end(); ++si) { - this->WriteHeaderSource(*si); + std::vector<size_t> all_configs; + for (size_t ci = 0; ci < this->Configurations.size(); ++ci) { + all_configs.push_back(ci); } - std::vector<cmSourceFile const*> idlSources; - this->GeneratorTarget->GetIDLSources(idlSources, ""); - this->WriteSources("Midl", idlSources); - std::vector<cmSourceFile const*> objectSources; - this->GeneratorTarget->GetObjectSources(objectSources, ""); - for (std::vector<cmSourceFile const*>::const_iterator si = - objectSources.begin(); - si != objectSources.end(); ++si) { - const std::string& lang = (*si)->GetLanguage(); + std::vector<cmGeneratorTarget::AllConfigSource> const& sources = + this->GeneratorTarget->GetAllConfigSources(); + + for (std::vector<cmGeneratorTarget::AllConfigSource>::const_iterator si = + sources.begin(); + si != sources.end(); ++si) { std::string tool; - if (lang == "C" || lang == "CXX") { - tool = "ClCompile"; - } else if (lang == "ASM_MASM" && this->GlobalGenerator->IsMasmEnabled()) { - tool = "MASM"; - } else if (lang == "ASM_NASM" && this->GlobalGenerator->IsNasmEnabled()) { - tool = "NASM"; - } else if (lang == "RC") { - tool = "ResourceCompile"; - } else if (lang == "CSharp") { - tool = "Compile"; - } else if (lang == "CUDA" && this->GlobalGenerator->IsCudaEnabled()) { - tool = "CudaCompile"; + switch (si->Kind) { + case cmGeneratorTarget::SourceKindAppManifest: + tool = "AppxManifest"; + break; + case cmGeneratorTarget::SourceKindCertificate: + tool = "None"; + break; + case cmGeneratorTarget::SourceKindCustomCommand: + // Handled elsewhere. + break; + case cmGeneratorTarget::SourceKindExternalObject: + tool = "Object"; + if (this->LocalGenerator->GetVersion() < + cmGlobalVisualStudioGenerator::VS11) { + // For VS == 10 we cannot use LinkObjects to avoid linking custom + // command outputs. If an object file is generated in this target, + // then vs10 will use it in the build, and we have to list it as + // None instead of Object. + std::vector<cmSourceFile*> const* d = + this->GeneratorTarget->GetSourceDepends(si->Source); + if (d && !d->empty()) { + tool = "None"; + } + } + break; + case cmGeneratorTarget::SourceKindExtra: + this->WriteExtraSource(si->Source); + break; + case cmGeneratorTarget::SourceKindHeader: + this->WriteHeaderSource(si->Source); + break; + case cmGeneratorTarget::SourceKindIDL: + tool = "Midl"; + break; + case cmGeneratorTarget::SourceKindManifest: + // Handled elsewhere. + break; + case cmGeneratorTarget::SourceKindModuleDefinition: + tool = "None"; + break; + case cmGeneratorTarget::SourceKindObjectSource: { + const std::string& lang = si->Source->GetLanguage(); + if (lang == "C" || lang == "CXX") { + tool = "ClCompile"; + } else if (lang == "ASM_MASM" && + this->GlobalGenerator->IsMasmEnabled()) { + tool = "MASM"; + } else if (lang == "ASM_NASM" && + this->GlobalGenerator->IsNasmEnabled()) { + tool = "NASM"; + } else if (lang == "RC") { + tool = "ResourceCompile"; + } else if (lang == "CSharp") { + tool = "Compile"; + } else if (lang == "CUDA" && this->GlobalGenerator->IsCudaEnabled()) { + tool = "CudaCompile"; + } else { + tool = "None"; + } + } break; + case cmGeneratorTarget::SourceKindResx: + // Handled elsewhere. + break; + case cmGeneratorTarget::SourceKindXaml: + // Handled elsewhere. + break; } if (!tool.empty()) { - this->WriteSource(tool, *si, " "); - if (this->OutputSourceSpecificFlags(*si)) { + // Compute set of configurations to exclude, if any. + std::vector<size_t> const& include_configs = si->Configs; + std::vector<size_t> exclude_configs; + std::set_difference(all_configs.begin(), all_configs.end(), + include_configs.begin(), include_configs.end(), + std::back_inserter(exclude_configs)); + + if (si->Kind == cmGeneratorTarget::SourceKindObjectSource) { + // FIXME: refactor generation to avoid tracking XML syntax state. + this->WriteSource(tool, si->Source, " "); + bool have_nested = this->OutputSourceSpecificFlags(si->Source); + if (!exclude_configs.empty()) { + if (!have_nested) { + (*this->BuildFileStream) << ">\n"; + } + this->WriteExcludeFromBuild(exclude_configs); + have_nested = true; + } + if (have_nested) { + this->WriteString("</", 2); + (*this->BuildFileStream) << tool << ">\n"; + } else { + (*this->BuildFileStream) << " />\n"; + } + } else if (!exclude_configs.empty()) { + this->WriteSource(tool, si->Source, ">\n"); + this->WriteExcludeFromBuild(exclude_configs); this->WriteString("</", 2); (*this->BuildFileStream) << tool << ">\n"; } else { - (*this->BuildFileStream) << " />\n"; + this->WriteSource(tool, si->Source); } - } else { - this->WriteSource("None", *si); - } - } - - std::vector<cmSourceFile const*> manifestSources; - this->GeneratorTarget->GetAppManifest(manifestSources, ""); - this->WriteSources("AppxManifest", manifestSources); - - std::vector<cmSourceFile const*> certificateSources; - this->GeneratorTarget->GetCertificates(certificateSources, ""); - this->WriteSources("None", certificateSources); - - std::vector<cmSourceFile const*> externalObjects; - this->GeneratorTarget->GetExternalObjects(externalObjects, ""); - if (this->LocalGenerator->GetVersion() > - cmGlobalVisualStudioGenerator::VS10) { - // For VS >= 11 we use LinkObjects to avoid linking custom command - // outputs. Use Object for all external objects, generated or not. - this->WriteSources("Object", externalObjects); - } else { - // If an object file is generated in this target, then vs10 will use - // it in the build, and we have to list it as None instead of Object. - for (std::vector<cmSourceFile const*>::const_iterator si = - externalObjects.begin(); - si != externalObjects.end(); ++si) { - std::vector<cmSourceFile*> const* d = - this->GeneratorTarget->GetSourceDepends(*si); - this->WriteSource((d && !d->empty()) ? "None" : "Object", *si); } } - std::vector<cmSourceFile const*> extraSources; - this->GeneratorTarget->GetExtraSources(extraSources, ""); - for (std::vector<cmSourceFile const*>::const_iterator si = - extraSources.begin(); - si != extraSources.end(); ++si) { - this->WriteExtraSource(*si); - } - - std::vector<cmSourceFile const*> defSources; - this->GeneratorTarget->GetModuleDefinitionSources(defSources, ""); - this->WriteSources("None", defSources); - if (this->IsMissingFiles) { this->WriteMissingFiles(); } @@ -1859,7 +1881,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( std::string lang = this->GlobalGenerator->GetLanguageFromExtension(sf.GetExtension().c_str()); std::string sourceLang = this->LocalGenerator->GetSourceFileLanguage(sf); - const std::string& linkLanguage = this->GeneratorTarget->GetLinkerLanguage(); + const std::string& linkLanguage = + this->GeneratorTarget->GetLinkerLanguage(""); bool needForceLang = false; // source file does not match its extension language if (lang != sourceLang) { @@ -2004,6 +2027,19 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( return hasFlags; } +void cmVisualStudio10TargetGenerator::WriteExcludeFromBuild( + std::vector<size_t> const& exclude_configs) +{ + for (std::vector<size_t>::const_iterator ci = exclude_configs.begin(); + ci != exclude_configs.end(); ++ci) { + this->WriteString("", 3); + (*this->BuildFileStream) + << "<ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='" + << cmVS10EscapeXML(this->Configurations[*ci]) << "|" + << cmVS10EscapeXML(this->Platform) << "'\">true</ExcludedFromBuild>\n"; + } +} + void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() { cmStateEnums::TargetType ttype = this->GeneratorTarget->GetType(); diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 52d5550..bd270bf 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -3,7 +3,7 @@ #ifndef cmVisualStudioTargetGenerator_h #define cmVisualStudioTargetGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <map> @@ -62,8 +62,7 @@ private: void WriteNsightTegraConfigurationValues(std::string const& config); void WriteSource(std::string const& tool, cmSourceFile const* sf, const char* end = 0); - void WriteSources(std::string const& tool, - std::vector<cmSourceFile const*> const&); + void WriteExcludeFromBuild(std::vector<size_t> const& exclude_configs); void WriteAllSources(); void WriteDotNetReferences(); void WriteDotNetReference(std::string const& ref, std::string const& hint); diff --git a/Source/cmVisualStudio10ToolsetOptions.h b/Source/cmVisualStudio10ToolsetOptions.h index 2459f5e..4233337 100644 --- a/Source/cmVisualStudio10ToolsetOptions.h +++ b/Source/cmVisualStudio10ToolsetOptions.h @@ -3,7 +3,7 @@ #ifndef cmVisualStudio10ToolsetOptions_h #define cmVisualStudio10ToolsetOptions_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index abc4924..1f808c8 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -101,10 +101,6 @@ void cmVisualStudioGeneratorOptions::FixExceptionHandlingDefault() // the flag to disable exception handling. When the user does // remove the flag we need to override the IDE default of on. switch (this->Version) { - case cmGlobalVisualStudioGenerator::VS7: - case cmGlobalVisualStudioGenerator::VS71: - this->FlagMap["ExceptionHandling"] = "FALSE"; - break; case cmGlobalVisualStudioGenerator::VS10: case cmGlobalVisualStudioGenerator::VS11: case cmGlobalVisualStudioGenerator::VS12: diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h index 52689e0..44d2719 100644 --- a/Source/cmVisualStudioGeneratorOptions.h +++ b/Source/cmVisualStudioGeneratorOptions.h @@ -3,7 +3,7 @@ #ifndef cmVisualStudioGeneratorOptions_h #define cmVisualStudioGeneratorOptions_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iosfwd> #include <string> diff --git a/Source/cmVisualStudioSlnData.h b/Source/cmVisualStudioSlnData.h index b2f8db9..e12047f 100644 --- a/Source/cmVisualStudioSlnData.h +++ b/Source/cmVisualStudioSlnData.h @@ -3,7 +3,7 @@ #ifndef cmVisualStudioSlnData_h #define cmVisualStudioSlnData_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <map> #include <string> diff --git a/Source/cmVisualStudioSlnParser.cxx b/Source/cmVisualStudioSlnParser.cxx index 939120a..1a32aba 100644 --- a/Source/cmVisualStudioSlnParser.cxx +++ b/Source/cmVisualStudioSlnParser.cxx @@ -4,7 +4,7 @@ #include "cmSystemTools.h" #include "cmVisualStudioSlnData.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <cassert> #include <stack> diff --git a/Source/cmVisualStudioSlnParser.h b/Source/cmVisualStudioSlnParser.h index a3391a6..d517324 100644 --- a/Source/cmVisualStudioSlnParser.h +++ b/Source/cmVisualStudioSlnParser.h @@ -3,7 +3,7 @@ #ifndef cmVisualStudioSlnParser_h #define cmVisualStudioSlnParser_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <bitset> #include <iosfwd> diff --git a/Source/cmVisualStudioWCEPlatformParser.h b/Source/cmVisualStudioWCEPlatformParser.h index 8ed6083..75c3d1a 100644 --- a/Source/cmVisualStudioWCEPlatformParser.h +++ b/Source/cmVisualStudioWCEPlatformParser.h @@ -3,7 +3,7 @@ #ifndef cmVisualStudioWCEPlatformParser_h #define cmVisualStudioWCEPlatformParser_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <map> #include <stddef.h> diff --git a/Source/cmWhileCommand.h b/Source/cmWhileCommand.h index abd36b3..daf1046 100644 --- a/Source/cmWhileCommand.h +++ b/Source/cmWhileCommand.h @@ -3,7 +3,8 @@ #ifndef cmWhileCommand_h #define cmWhileCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmWorkingDirectory.h b/Source/cmWorkingDirectory.h index af0fd44..aff9267 100644 --- a/Source/cmWorkingDirectory.h +++ b/Source/cmWorkingDirectory.h @@ -3,7 +3,7 @@ #ifndef cmWorkingDirectory_h #define cmWorkingDirectory_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx index ce2de57..f569e80 100644 --- a/Source/cmWriteFileCommand.cxx +++ b/Source/cmWriteFileCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWriteFileCommand.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include "cmMakefile.h" #include "cmSystemTools.h" diff --git a/Source/cmWriteFileCommand.h b/Source/cmWriteFileCommand.h index 73e6e22..7196ccf 100644 --- a/Source/cmWriteFileCommand.h +++ b/Source/cmWriteFileCommand.h @@ -3,7 +3,8 @@ #ifndef cmWriteFileCommand_h #define cmWriteFileCommand_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include <vector> diff --git a/Source/cmXCode21Object.h b/Source/cmXCode21Object.h index 083d229..bcd8d93 100644 --- a/Source/cmXCode21Object.h +++ b/Source/cmXCode21Object.h @@ -3,7 +3,7 @@ #ifndef cmXCode21Object_h #define cmXCode21Object_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> #include <vector> diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h index 3bfecdf..b92e6e3 100644 --- a/Source/cmXCodeObject.h +++ b/Source/cmXCodeObject.h @@ -3,7 +3,7 @@ #ifndef cmXCodeObject_h #define cmXCodeObject_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <algorithm> #include <iosfwd> diff --git a/Source/cmXCodeScheme.h b/Source/cmXCodeScheme.h index 0a8e737..379afed 100644 --- a/Source/cmXCodeScheme.h +++ b/Source/cmXCodeScheme.h @@ -3,7 +3,7 @@ #ifndef cmXCodeScheme_h #define cmXCodeScheme_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmGlobalXCodeGenerator.h" #include "cmSystemTools.h" diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx index 231e95e..18afbf3 100644 --- a/Source/cmXMLParser.cxx +++ b/Source/cmXMLParser.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmXMLParser.h" -#include <cm_expat.h> -#include <cmsys/FStream.hxx> +#include "cm_expat.h" +#include "cmsys/FStream.hxx" #include <ctype.h> #include <iostream> #include <sstream> diff --git a/Source/cmXMLParser.h b/Source/cmXMLParser.h index 60da51e..98ba049 100644 --- a/Source/cmXMLParser.h +++ b/Source/cmXMLParser.h @@ -3,7 +3,7 @@ #ifndef cmXMLParser_h #define cmXMLParser_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> diff --git a/Source/cmXMLSafe.h b/Source/cmXMLSafe.h index c41554d..9aaf2d1 100644 --- a/Source/cmXMLSafe.h +++ b/Source/cmXMLSafe.h @@ -3,7 +3,7 @@ #ifndef cmXMLSafe_h #define cmXMLSafe_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> #include <string> diff --git a/Source/cmXMLWriter.cxx b/Source/cmXMLWriter.cxx index 541cb3d..3cbc70d 100644 --- a/Source/cmXMLWriter.cxx +++ b/Source/cmXMLWriter.cxx @@ -2,8 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmXMLWriter.h" +#include "cmsys/FStream.hxx" #include <cassert> -#include <cmsys/FStream.hxx> cmXMLWriter::cmXMLWriter(std::ostream& output, std::size_t level) : Output(output) diff --git a/Source/cmXMLWriter.h b/Source/cmXMLWriter.h index 6d1e6b4..14c82b1 100644 --- a/Source/cmXMLWriter.h +++ b/Source/cmXMLWriter.h @@ -3,7 +3,7 @@ #ifndef cmXMLWiter_h #define cmXMLWiter_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include "cmXMLSafe.h" diff --git a/Source/cm_auto_ptr.hxx b/Source/cm_auto_ptr.hxx index 5382018..2b5c059 100644 --- a/Source/cm_auto_ptr.hxx +++ b/Source/cm_auto_ptr.hxx @@ -3,7 +3,7 @@ #ifndef CM_AUTO_PTR_HXX #define CM_AUTO_PTR_HXX -#include <cmConfigure.h> +#include "cmConfigure.h" #ifdef CMake_HAVE_CXX_AUTO_PTR diff --git a/Source/cm_codecvt.cxx b/Source/cm_codecvt.cxx index 869dd32..fcd1e48 100644 --- a/Source/cm_codecvt.cxx +++ b/Source/cm_codecvt.cxx @@ -6,7 +6,7 @@ #if defined(_WIN32) #include <windows.h> #undef max -#include <cmsys/Encoding.hxx> +#include "cmsys/Encoding.hxx" #endif codecvt::codecvt(Encoding e) diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx index fcd9954..b9b52ec 100644 --- a/Source/cm_codecvt.hxx +++ b/Source/cm_codecvt.hxx @@ -3,7 +3,7 @@ #ifndef cm_codecvt_hxx #define cm_codecvt_hxx -#include <cmConfigure.h> +#include "cmConfigure.h" #include <locale> #include <vector> diff --git a/Source/cm_unordered_map.hxx b/Source/cm_unordered_map.hxx index dc8ca35..bf38903 100644 --- a/Source/cm_unordered_map.hxx +++ b/Source/cm_unordered_map.hxx @@ -3,7 +3,7 @@ #ifndef CM_UNORDERED_MAP_HXX #define CM_UNORDERED_MAP_HXX -#include <cmConfigure.h> +#include "cmConfigure.h" #if defined(CMake_HAVE_CXX_UNORDERED_MAP) @@ -12,7 +12,7 @@ #elif defined(CMAKE_BUILD_WITH_CMAKE) -#include <cmsys/hash_map.hxx> +#include "cmsys/hash_map.hxx" #define CM_UNORDERED_MAP cmsys::hash_map #else diff --git a/Source/cm_unordered_set.hxx b/Source/cm_unordered_set.hxx index ce58dbf..dd1a9a1 100644 --- a/Source/cm_unordered_set.hxx +++ b/Source/cm_unordered_set.hxx @@ -3,7 +3,7 @@ #ifndef CM_UNORDERED_SET_HXX #define CM_UNORDERED_SET_HXX -#include <cmConfigure.h> +#include "cmConfigure.h" #if defined(CMake_HAVE_CXX_UNORDERED_SET) @@ -12,7 +12,7 @@ #elif defined(CMAKE_BUILD_WITH_CMAKE) -#include <cmsys/hash_set.hxx> +#include "cmsys/hash_set.hxx" #define CM_UNORDERED_SET cmsys::hash_set #else diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 4363c12..737587d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -28,7 +28,7 @@ #include "cm_sys_stat.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include <cm_jsoncpp_writer.h> +#include "cm_jsoncpp_writer.h" #include "cmGraphVizWriter.h" #include "cmVariableWatch.h" @@ -63,7 +63,6 @@ #include "cmGlobalVisualStudio12Generator.h" #include "cmGlobalVisualStudio14Generator.h" #include "cmGlobalVisualStudio15Generator.h" -#include "cmGlobalVisualStudio71Generator.h" #include "cmGlobalVisualStudio8Generator.h" #include "cmGlobalVisualStudio9Generator.h" #include "cmVSSetupHelper.h" @@ -107,10 +106,10 @@ #include <sys/time.h> #endif +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" +#include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/RegularExpression.hxx> #include <iostream> #include <sstream> #include <stdio.h> @@ -1461,8 +1460,7 @@ void cmake::CreateDefaultGlobalGenerator() { "11.0", "Visual Studio 11 2012" }, // { "10.0", "Visual Studio 10 2010" }, // { "9.0", "Visual Studio 9 2008" }, // - { "8.0", "Visual Studio 8 2005" }, // - { "7.1", "Visual Studio 7 .NET 2003" } + { "8.0", "Visual Studio 8 2005" } }; static const char* const vsEntries[] = { "\\Setup\\VC;ProductDir", // @@ -1672,7 +1670,6 @@ void cmake::AddDefaultGenerators() this->Generators.push_back(cmGlobalVisualStudio10Generator::NewFactory()); this->Generators.push_back(cmGlobalVisualStudio9Generator::NewFactory()); this->Generators.push_back(cmGlobalVisualStudio8Generator::NewFactory()); - this->Generators.push_back(cmGlobalVisualStudio71Generator::NewFactory()); this->Generators.push_back(cmGlobalBorlandMakefileGenerator::NewFactory()); this->Generators.push_back(cmGlobalNMakeMakefileGenerator::NewFactory()); this->Generators.push_back(cmGlobalJOMMakefileGenerator::NewFactory()); diff --git a/Source/cmake.h b/Source/cmake.h index abb13ac..4c292f0 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -3,7 +3,7 @@ #ifndef cmake_h #define cmake_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <map> #include <set> @@ -16,7 +16,7 @@ #include "cmStateTypes.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include <cm_jsoncpp_value.h> +#include "cm_jsoncpp_value.h" #endif class cmExternalMakefileProjectGeneratorFactory; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 805a9f7..3d11241 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -1,6 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" @@ -17,9 +17,9 @@ #include "cmDynamicLoader.h" #endif -#include <cmsys/Encoding.hxx> +#include "cmsys/Encoding.hxx" #if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) -#include <cmsys/ConsoleBuf.hxx> +#include "cmsys/ConsoleBuf.hxx" #endif #include <iostream> #include <string.h> @@ -27,7 +27,7 @@ #include <vector> #ifdef CMAKE_USE_LIBUV -#include <cm_uv.h> +#include "cm_uv.h" #endif #ifdef CMAKE_BUILD_WITH_CMAKE diff --git a/Source/cmakexbuild.cxx b/Source/cmakexbuild.cxx index e166bee..f1f4bbb 100644 --- a/Source/cmakexbuild.cxx +++ b/Source/cmakexbuild.cxx @@ -1,9 +1,9 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep -#include <cmsys/Process.h> +#include "cmsys/Process.h" #include <iostream> #include <string> #include <vector> diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx index b86ad6e..0c5bbe2 100644 --- a/Source/cmcldeps.cxx +++ b/Source/cmcldeps.cxx @@ -18,8 +18,8 @@ // /showIncludes is equivalent to -MD, not -MMD, that is, system headers are // included. -#include <cmSystemTools.h> -#include <cmsys/Encoding.hxx> +#include "cmSystemTools.h" +#include "cmsys/Encoding.hxx" #include <algorithm> #include <sstream> diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 9e08b9c..974dd5f 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -32,12 +32,12 @@ #include "cmVisualStudioWCEPlatformParser.h" #endif +#include "cmConfigure.h" +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" +#include "cmsys/Process.h" +#include "cmsys/Terminal.h" #include <algorithm> -#include <cmConfigure.h> -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/Process.h> -#include <cmsys/Terminal.h> #include <iostream> #include <sstream> #include <stdio.h> diff --git a/Source/cmcmd.h b/Source/cmcmd.h index 139d2a8..929f1ae 100644 --- a/Source/cmcmd.h +++ b/Source/cmcmd.h @@ -3,7 +3,7 @@ #ifndef cmcmd_h #define cmcmd_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 1cf75c8..135062d 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -1,6 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include <cmConfigure.h> +#include "cmConfigure.h" #include "CTest/cmCTestLaunch.h" #include "CTest/cmCTestScriptHandler.h" @@ -9,9 +9,9 @@ #include "cmSystemTools.h" #include "cmake.h" -#include <cmsys/Encoding.hxx> +#include "cmsys/Encoding.hxx" #if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) -#include <cmsys/ConsoleBuf.hxx> +#include "cmsys/ConsoleBuf.hxx" #endif #include <iostream> #include <string.h> diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index de68118..e15b49e 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -69,6 +69,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) FOREACH(p CMP0025 # CMake 3.0, Compiler id for Apple Clang is now AppleClang. + CMP0048 # CMake 3.0, Let the project command manage version variables. CMP0056 # CMake 3.2, Honor link flags in try_compile() source-file signature. CMP0063 # CMake 3.3, Honor visibility properties for all target types. ) @@ -796,6 +797,8 @@ ENDFOREACH() IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) ADD_LIBRARY(${KWSYS_NAMESPACE} ${KWSYS_LIBRARY_TYPE} ${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY C_INCLUDE_WHAT_YOU_USE "") + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY CXX_INCLUDE_WHAT_YOU_USE "") SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY LABELS ${KWSYS_LABELS_LIB}) IF(KWSYS_USE_DynamicLoader) IF(UNIX) @@ -940,6 +943,8 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) ENDIF() IF(KWSYS_USE_ConsoleBuf) ADD_EXECUTABLE(testConsoleBufChild testConsoleBufChild.cxx) + SET_PROPERTY(TARGET testConsoleBufChild PROPERTY C_INCLUDE_WHAT_YOU_USE "") + SET_PROPERTY(TARGET testConsoleBufChild PROPERTY CXX_INCLUDE_WHAT_YOU_USE "") SET_PROPERTY(TARGET testConsoleBufChild PROPERTY LABELS ${KWSYS_LABELS_EXE}) TARGET_LINK_LIBRARIES(testConsoleBufChild ${KWSYS_NAMESPACE}) SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS} @@ -967,6 +972,8 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) ${KWSYS_CXX_TESTS} ) ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestsCxx ${KWSYS_CXX_TEST_SRCS}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsCxx PROPERTY C_INCLUDE_WHAT_YOU_USE "") + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsCxx PROPERTY CXX_INCLUDE_WHAT_YOU_USE "") SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsCxx PROPERTY LABELS ${KWSYS_LABELS_EXE}) TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestsCxx ${KWSYS_NAMESPACE}) diff --git a/Source/kwsys/Encoding.hxx.in b/Source/kwsys/Encoding.hxx.in index bf93f50..09691fd 100644 --- a/Source/kwsys/Encoding.hxx.in +++ b/Source/kwsys/Encoding.hxx.in @@ -59,6 +59,17 @@ public: static std::string ToNarrow(const std::wstring& str); static std::string ToNarrow(const wchar_t* str); +#if defined(_WIN32) + /** + * Convert the path to an extended length path to avoid MAX_PATH length + * limitations on Windows. If the input is a local path the result will be + * prefixed with \\?\; if the input is instead a network path, the result + * will be prefixed with \\?\UNC\. All output will also be converted to + * absolute paths with Windows-style backslashes. + **/ + static std::wstring ToWindowsExtendedPath(std::string const&); +#endif + #endif // @KWSYS_NAMESPACE@_STL_HAS_WSTRING }; // class Encoding diff --git a/Source/kwsys/EncodingCXX.cxx b/Source/kwsys/EncodingCXX.cxx index e904c1a..641c0e6 100644 --- a/Source/kwsys/EncodingCXX.cxx +++ b/Source/kwsys/EncodingCXX.cxx @@ -29,6 +29,7 @@ #if defined(_WIN32) #include <windows.h> +#include <ctype.h> #include <shellapi.h> #endif @@ -214,6 +215,63 @@ std::string Encoding::ToNarrow(const wchar_t* wcstr) } return str; } + +#if defined(_WIN32) +// Convert local paths to UNC style paths +std::wstring Encoding::ToWindowsExtendedPath(std::string const& source) +{ + std::wstring wsource = Encoding::ToWide(source); + + // Resolve any relative paths + DWORD wfull_len; + + /* The +3 is a workaround for a bug in some versions of GetFullPathNameW that + * won't return a large enough buffer size if the input is too small */ + wfull_len = GetFullPathNameW(wsource.c_str(), 0, NULL, NULL) + 3; + std::vector<wchar_t> wfull(wfull_len); + GetFullPathNameW(wsource.c_str(), wfull_len, &wfull[0], NULL); + + /* This should get the correct size without any extra padding from the + * previous size workaround. */ + wfull_len = static_cast<DWORD>(wcslen(&wfull[0])); + + if (wfull_len >= 2 && isalpha(wfull[0]) && + wfull[1] == L':') { /* C:\Foo\bar\FooBar.txt */ + return L"\\\\?\\" + std::wstring(&wfull[0]); + } else if (wfull_len >= 2 && wfull[0] == L'\\' && + wfull[1] == L'\\') { /* Starts with \\ */ + if (wfull_len >= 4 && wfull[2] == L'?' && + wfull[3] == L'\\') { /* Starts with \\?\ */ + if (wfull_len >= 8 && wfull[4] == L'U' && wfull[5] == L'N' && + wfull[6] == L'C' && + wfull[7] == L'\\') { /* \\?\UNC\Foo\bar\FooBar.txt */ + return std::wstring(&wfull[0]); + } else if (wfull_len >= 6 && isalpha(wfull[4]) && + wfull[5] == L':') { /* \\?\C:\Foo\bar\FooBar.txt */ + return std::wstring(&wfull[0]); + } else if (wfull_len >= 5) { /* \\?\Foo\bar\FooBar.txt */ + return L"\\\\?\\UNC\\" + std::wstring(&wfull[4]); + } + } else if (wfull_len >= 4 && wfull[2] == L'.' && + wfull[3] == L'\\') { /* Starts with \\.\ a device name */ + if (wfull_len >= 6 && isalpha(wfull[4]) && + wfull[5] == L':') { /* \\.\C:\Foo\bar\FooBar.txt */ + return L"\\\\?\\" + std::wstring(&wfull[4]); + } else if (wfull_len >= + 5) { /* \\.\Foo\bar\ Device name is left unchanged */ + return std::wstring(&wfull[0]); + } + } else if (wfull_len >= 3) { /* \\Foo\bar\FooBar.txt */ + return L"\\\\?\\UNC\\" + std::wstring(&wfull[2]); + } + } + + // If this case has been reached, then the path is invalid. Leave it + // unchanged + return Encoding::ToWide(source); +} +#endif + #endif // KWSYS_STL_HAS_WSTRING } // namespace KWSYS_NAMESPACE diff --git a/Source/kwsys/FStream.hxx.in b/Source/kwsys/FStream.hxx.in index d4bc6c9..a4c65fe 100644 --- a/Source/kwsys/FStream.hxx.in +++ b/Source/kwsys/FStream.hxx.in @@ -33,7 +33,7 @@ public: typedef std::basic_filebuf<CharType, Traits> my_base_type; basic_filebuf* open(char const* s, std::ios_base::openmode mode) { - const std::wstring wstr = Encoding::ToWide(s); + const std::wstring wstr = Encoding::ToWindowsExtendedPath(s); return static_cast<basic_filebuf*>(my_base_type::open(wstr.c_str(), mode)); } #endif @@ -93,7 +93,7 @@ public: #if defined(_MSC_VER) const bool success = buf_->open(file_name, mode) != 0; #else - const std::wstring wstr = Encoding::ToWide(file_name); + const std::wstring wstr = Encoding::ToWindowsExtendedPath(file_name); bool success = false; std::wstring cmode = getcmode(mode); file_ = _wfopen(wstr.c_str(), cmode.c_str()); diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 93312e9..70f1a43 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -4341,18 +4341,35 @@ unsigned char SystemInformationImplementation::GetAPICId() void SystemInformationImplementation::CPUCountWindows() { #if defined(_WIN32) - std::vector<SYSTEM_LOGICAL_PROCESSOR_INFORMATION> ProcInfo; this->NumberOfPhysicalCPU = 0; this->NumberOfLogicalCPU = 0; + typedef BOOL(WINAPI * GetLogicalProcessorInformationType)( + PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, PDWORD); + static GetLogicalProcessorInformationType pGetLogicalProcessorInformation = + (GetLogicalProcessorInformationType)GetProcAddress( + GetModuleHandleW(L"kernel32"), "GetLogicalProcessorInformation"); + + if (!pGetLogicalProcessorInformation) { + // Fallback to approximate implementation on ancient Windows versions. + SYSTEM_INFO info; + ZeroMemory(&info, sizeof(info)); + GetSystemInfo(&info); + this->NumberOfPhysicalCPU = + static_cast<unsigned int>(info.dwNumberOfProcessors); + this->NumberOfLogicalCPU = this->NumberOfPhysicalCPU; + return; + } + + std::vector<SYSTEM_LOGICAL_PROCESSOR_INFORMATION> ProcInfo; { DWORD Length = 0; - DWORD rc = GetLogicalProcessorInformation(NULL, &Length); + DWORD rc = pGetLogicalProcessorInformation(NULL, &Length); assert(FALSE == rc); (void)rc; // Silence unused variable warning in Borland C++ 5.81 assert(GetLastError() == ERROR_INSUFFICIENT_BUFFER); ProcInfo.resize(Length / sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION)); - rc = GetLogicalProcessorInformation(&ProcInfo[0], &Length); + rc = pGetLogicalProcessorInformation(&ProcInfo[0], &Length); assert(rc != FALSE); (void)rc; // Silence unused variable warning in Borland C++ 5.81 } diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 65b7b26..b6da368 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -54,7 +54,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/stat.h> #include <time.h> #if defined(_WIN32) && !defined(_MSC_VER) && defined(__GNUC__) @@ -217,12 +216,12 @@ static time_t windows_filetime_to_posix_time(const FILETIME& ft) inline int Mkdir(const std::string& dir) { return _wmkdir( - KWSYS_NAMESPACE::SystemTools::ConvertToWindowsExtendedPath(dir).c_str()); + KWSYS_NAMESPACE::Encoding::ToWindowsExtendedPath(dir).c_str()); } inline int Rmdir(const std::string& dir) { return _wrmdir( - KWSYS_NAMESPACE::SystemTools::ConvertToWindowsExtendedPath(dir).c_str()); + KWSYS_NAMESPACE::Encoding::ToWindowsExtendedPath(dir).c_str()); } inline const char* Getcwd(char* buf, unsigned int len) { @@ -746,7 +745,7 @@ const char* SystemTools::GetExecutableExtension() FILE* SystemTools::Fopen(const std::string& file, const char* mode) { #ifdef _WIN32 - return _wfopen(SystemTools::ConvertToWindowsExtendedPath(file).c_str(), + return _wfopen(Encoding::ToWindowsExtendedPath(file).c_str(), Encoding::ToWide(mode).c_str()); #else return fopen(file.c_str(), mode); @@ -1160,8 +1159,7 @@ bool SystemTools::PathExists(const std::string& path) struct stat st; return lstat(path.c_str(), &st) == 0; #elif defined(_WIN32) - return (GetFileAttributesW( - SystemTools::ConvertToWindowsExtendedPath(path).c_str()) != + return (GetFileAttributesW(Encoding::ToWindowsExtendedPath(path).c_str()) != INVALID_FILE_ATTRIBUTES); #else struct stat st; @@ -1192,9 +1190,9 @@ bool SystemTools::FileExists(const std::string& filename) } return access(filename.c_str(), R_OK) == 0; #elif defined(_WIN32) - return (GetFileAttributesW( - SystemTools::ConvertToWindowsExtendedPath(filename).c_str()) != - INVALID_FILE_ATTRIBUTES); + return ( + GetFileAttributesW(Encoding::ToWindowsExtendedPath(filename).c_str()) != + INVALID_FILE_ATTRIBUTES); #else // SCO OpenServer 5.0.7/3.2's command has 711 permission. #if defined(_SCO_DS) @@ -1250,7 +1248,7 @@ bool SystemTools::TestFileAccess(const std::string& filename, permissions &= ~TEST_FILE_EXECUTE; permissions |= TEST_FILE_READ; } - return _waccess(SystemTools::ConvertToWindowsExtendedPath(filename).c_str(), + return _waccess(Encoding::ToWindowsExtendedPath(filename).c_str(), permissions) == 0; #else return access(filename.c_str(), permissions) == 0; @@ -1258,6 +1256,38 @@ bool SystemTools::TestFileAccess(const std::string& filename, } //---------------------------------------------------------------------------- +int SystemTools::Stat(const char* path, SystemTools::Stat_t* buf) +{ + if (!path) { + errno = EFAULT; + return -1; + } + return SystemTools::Stat(std::string(path), buf); +} + +//---------------------------------------------------------------------------- +int SystemTools::Stat(const std::string& path, SystemTools::Stat_t* buf) +{ + if (path.empty()) { + errno = ENOENT; + return -1; + } +#if defined(_WIN32) && !defined(__CYGWIN__) + // Ideally we should use Encoding::ToWindowsExtendedPath to support + // long paths, but _wstat64 rejects paths with '?' in them, thinking + // they are wildcards. + std::wstring const& wpath = Encoding::ToWide(path); +#if defined(__BORLANDC__) + return _wstati64(wpath.c_str(), buf); +#else + return _wstat64(wpath.c_str(), buf); +#endif +#else + return stat(path.c_str(), buf); +#endif +} + +//---------------------------------------------------------------------------- #ifdef __CYGWIN__ bool SystemTools::PathCygwinToWin32(const char* path, char* win32_path) { @@ -1293,10 +1323,9 @@ bool SystemTools::Touch(const std::string& filename, bool create) } } #if defined(_WIN32) && !defined(__CYGWIN__) - HANDLE h = - CreateFileW(SystemTools::ConvertToWindowsExtendedPath(filename).c_str(), - FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, 0, OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, 0); + HANDLE h = CreateFileW(Encoding::ToWindowsExtendedPath(filename).c_str(), + FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, 0, + OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); if (!h) { return false; } @@ -1394,14 +1423,12 @@ bool SystemTools::FileTimeCompare(const std::string& f1, const std::string& f2, // Windows version. Get the modification time from extended file attributes. WIN32_FILE_ATTRIBUTE_DATA f1d; WIN32_FILE_ATTRIBUTE_DATA f2d; - if (!GetFileAttributesExW( - SystemTools::ConvertToWindowsExtendedPath(f1).c_str(), - GetFileExInfoStandard, &f1d)) { + if (!GetFileAttributesExW(Encoding::ToWindowsExtendedPath(f1).c_str(), + GetFileExInfoStandard, &f1d)) { return false; } - if (!GetFileAttributesExW( - SystemTools::ConvertToWindowsExtendedPath(f2).c_str(), - GetFileExInfoStandard, &f2d)) { + if (!GetFileAttributesExW(Encoding::ToWindowsExtendedPath(f2).c_str(), + GetFileExInfoStandard, &f2d)) { return false; } @@ -1929,59 +1956,10 @@ void SystemTools::ConvertToUnixSlashes(std::string& path) } #ifdef _WIN32 -// Convert local paths to UNC style paths std::wstring SystemTools::ConvertToWindowsExtendedPath( const std::string& source) { - std::wstring wsource = Encoding::ToWide(source); - - // Resolve any relative paths - DWORD wfull_len; - - /* The +3 is a workaround for a bug in some versions of GetFullPathNameW that - * won't return a large enough buffer size if the input is too small */ - wfull_len = GetFullPathNameW(wsource.c_str(), 0, NULL, NULL) + 3; - std::vector<wchar_t> wfull(wfull_len); - GetFullPathNameW(wsource.c_str(), wfull_len, &wfull[0], NULL); - - /* This should get the correct size without any extra padding from the - * previous size workaround. */ - wfull_len = static_cast<DWORD>(wcslen(&wfull[0])); - - if (wfull_len >= 2 && isalpha(wfull[0]) && - wfull[1] == L':') { /* C:\Foo\bar\FooBar.txt */ - return L"\\\\?\\" + std::wstring(&wfull[0]); - } else if (wfull_len >= 2 && wfull[0] == L'\\' && - wfull[1] == L'\\') { /* Starts with \\ */ - if (wfull_len >= 4 && wfull[2] == L'?' && - wfull[3] == L'\\') { /* Starts with \\?\ */ - if (wfull_len >= 8 && wfull[4] == L'U' && wfull[5] == L'N' && - wfull[6] == L'C' && - wfull[7] == L'\\') { /* \\?\UNC\Foo\bar\FooBar.txt */ - return std::wstring(&wfull[0]); - } else if (wfull_len >= 6 && isalpha(wfull[4]) && - wfull[5] == L':') { /* \\?\C:\Foo\bar\FooBar.txt */ - return std::wstring(&wfull[0]); - } else if (wfull_len >= 5) { /* \\?\Foo\bar\FooBar.txt */ - return L"\\\\?\\UNC\\" + std::wstring(&wfull[4]); - } - } else if (wfull_len >= 4 && wfull[2] == L'.' && - wfull[3] == L'\\') { /* Starts with \\.\ a device name */ - if (wfull_len >= 6 && isalpha(wfull[4]) && - wfull[5] == L':') { /* \\.\C:\Foo\bar\FooBar.txt */ - return L"\\\\?\\" + std::wstring(&wfull[4]); - } else if (wfull_len >= - 5) { /* \\.\Foo\bar\ Device name is left unchanged */ - return std::wstring(&wfull[0]); - } - } else if (wfull_len >= 3) { /* \\Foo\bar\FooBar.txt */ - return L"\\\\?\\UNC\\" + std::wstring(&wfull[2]); - } - } - - // If this case has been reached, then the path is invalid. Leave it - // unchanged - return Encoding::ToWide(source); + return Encoding::ToWindowsExtendedPath(source); } #endif @@ -2098,15 +2076,14 @@ bool SystemTools::FilesDiffer(const std::string& source, #if defined(_WIN32) WIN32_FILE_ATTRIBUTE_DATA statSource; - if (GetFileAttributesExW( - SystemTools::ConvertToWindowsExtendedPath(source).c_str(), - GetFileExInfoStandard, &statSource) == 0) { + if (GetFileAttributesExW(Encoding::ToWindowsExtendedPath(source).c_str(), + GetFileExInfoStandard, &statSource) == 0) { return true; } WIN32_FILE_ATTRIBUTE_DATA statDestination; if (GetFileAttributesExW( - SystemTools::ConvertToWindowsExtendedPath(destination).c_str(), + Encoding::ToWindowsExtendedPath(destination).c_str(), GetFileExInfoStandard, &statDestination) == 0) { return true; } @@ -2230,8 +2207,7 @@ bool SystemTools::CopyFileAlways(const std::string& source, // Open files #if defined(_WIN32) kwsys::ifstream fin( - Encoding::ToNarrow(SystemTools::ConvertToWindowsExtendedPath(source)) - .c_str(), + Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)).c_str(), std::ios::in | std::ios::binary); #else kwsys::ifstream fin(source.c_str(), std::ios::in | std::ios::binary); @@ -2248,8 +2224,7 @@ bool SystemTools::CopyFileAlways(const std::string& source, #if defined(_WIN32) kwsys::ofstream fout( - Encoding::ToNarrow( - SystemTools::ConvertToWindowsExtendedPath(real_destination)) + Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(real_destination)) .c_str(), std::ios::out | std::ios::trunc | std::ios::binary); #else @@ -2314,8 +2289,7 @@ bool SystemTools::CopyADirectory(const std::string& source, { Directory dir; #ifdef _WIN32 - dir.Load( - Encoding::ToNarrow(SystemTools::ConvertToWindowsExtendedPath(source))); + dir.Load(Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source))); #else dir.Load(source); #endif @@ -2353,9 +2327,8 @@ unsigned long SystemTools::FileLength(const std::string& filename) unsigned long length = 0; #ifdef _WIN32 WIN32_FILE_ATTRIBUTE_DATA fs; - if (GetFileAttributesExW( - SystemTools::ConvertToWindowsExtendedPath(filename).c_str(), - GetFileExInfoStandard, &fs) != 0) { + if (GetFileAttributesExW(Encoding::ToWindowsExtendedPath(filename).c_str(), + GetFileExInfoStandard, &fs) != 0) { /* To support the full 64-bit file size, use fs.nFileSizeHigh * and fs.nFileSizeLow to construct the 64 bit size @@ -2389,9 +2362,8 @@ long int SystemTools::ModifiedTime(const std::string& filename) long int mt = 0; #ifdef _WIN32 WIN32_FILE_ATTRIBUTE_DATA fs; - if (GetFileAttributesExW( - SystemTools::ConvertToWindowsExtendedPath(filename).c_str(), - GetFileExInfoStandard, &fs) != 0) { + if (GetFileAttributesExW(Encoding::ToWindowsExtendedPath(filename).c_str(), + GetFileExInfoStandard, &fs) != 0) { mt = windows_filetime_to_posix_time(fs.ftLastWriteTime); } #else @@ -2409,9 +2381,8 @@ long int SystemTools::CreationTime(const std::string& filename) long int ct = 0; #ifdef _WIN32 WIN32_FILE_ATTRIBUTE_DATA fs; - if (GetFileAttributesExW( - SystemTools::ConvertToWindowsExtendedPath(filename).c_str(), - GetFileExInfoStandard, &fs) != 0) { + if (GetFileAttributesExW(Encoding::ToWindowsExtendedPath(filename).c_str(), + GetFileExInfoStandard, &fs) != 0) { ct = windows_filetime_to_posix_time(fs.ftCreationTime); } #else @@ -2625,7 +2596,7 @@ static bool DeleteJunction(const std::wstring& source) bool SystemTools::RemoveFile(const std::string& source) { #ifdef _WIN32 - std::wstring const& ws = SystemTools::ConvertToWindowsExtendedPath(source); + std::wstring const& ws = Encoding::ToWindowsExtendedPath(source); if (DeleteFileW(ws.c_str())) { return true; } @@ -2675,8 +2646,7 @@ bool SystemTools::RemoveADirectory(const std::string& source) Directory dir; #ifdef _WIN32 - dir.Load( - Encoding::ToNarrow(SystemTools::ConvertToWindowsExtendedPath(source))); + dir.Load(Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source))); #else dir.Load(source); #endif @@ -3033,8 +3003,8 @@ bool SystemTools::FileIsDirectory(const std::string& inName) // Now check the file node type. #if defined(_WIN32) - DWORD attr = GetFileAttributesW( - SystemTools::ConvertToWindowsExtendedPath(name).c_str()); + DWORD attr = + GetFileAttributesW(Encoding::ToWindowsExtendedPath(name).c_str()); if (attr != INVALID_FILE_ATTRIBUTES) { return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0; #else @@ -3050,8 +3020,8 @@ bool SystemTools::FileIsDirectory(const std::string& inName) bool SystemTools::FileIsSymlink(const std::string& name) { #if defined(_WIN32) - DWORD attr = GetFileAttributesW( - SystemTools::ConvertToWindowsExtendedPath(name).c_str()); + DWORD attr = + GetFileAttributesW(Encoding::ToWindowsExtendedPath(name).c_str()); if (attr != INVALID_FILE_ATTRIBUTES) { return (attr & FILE_ATTRIBUTE_REPARSE_POINT) != 0; } else { @@ -4367,8 +4337,8 @@ bool SystemTools::GetPermissions(const char* file, mode_t& mode) bool SystemTools::GetPermissions(const std::string& file, mode_t& mode) { #if defined(_WIN32) - DWORD attr = GetFileAttributesW( - SystemTools::ConvertToWindowsExtendedPath(file).c_str()); + DWORD attr = + GetFileAttributesW(Encoding::ToWindowsExtendedPath(file).c_str()); if (attr == INVALID_FILE_ATTRIBUTES) { return false; } @@ -4420,8 +4390,7 @@ bool SystemTools::SetPermissions(const std::string& file, mode_t mode, mode &= ~currentMask; } #ifdef _WIN32 - if (_wchmod(SystemTools::ConvertToWindowsExtendedPath(file).c_str(), mode) < - 0) + if (_wchmod(Encoding::ToWindowsExtendedPath(file).c_str(), mode) < 0) #else if (chmod(file.c_str(), mode) < 0) #endif diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index 7a5256b..0849e1d 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -13,6 +13,9 @@ #include <@KWSYS_NAMESPACE@/String.hxx> #include <sys/types.h> +// include sys/stat.h after sys/types.h +#include <sys/stat.h> + #if !defined(_WIN32) || defined(__CYGWIN__) #include <unistd.h> // For access permissions for use with access() #endif @@ -262,13 +265,7 @@ public: static void ConvertToUnixSlashes(std::string& path); #ifdef _WIN32 - /** - * Convert the path to an extended length path to avoid MAX_PATH length - * limitations on Windows. If the input is a local path the result will be - * prefixed with \\?\; if the input is instead a network path, the result - * will be prefixed with \\?\UNC\. All output will also be converted to - * absolute paths with Windows-style backslashes. - **/ + /** Calls Encoding::ToWindowsExtendedPath. */ static std::wstring ConvertToWindowsExtendedPath(const std::string&); #endif @@ -324,6 +321,27 @@ public: TestFilePermissions permissions); static bool TestFileAccess(const std::string& filename, TestFilePermissions permissions); +/** + * Cross platform wrapper for stat struct + */ +#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(__BORLANDC__) + typedef struct stati64 Stat_t; +#else + typedef struct _stat64 Stat_t; +#endif +#else + typedef struct stat Stat_t; +#endif + + /** + * Cross platform wrapper for stat system call + * + * On Windows this may not work for paths longer than 250 characters + * due to limitations of the underlying '_wstat64' call. + */ + static int Stat(const char* path, Stat_t* buf); + static int Stat(const std::string& path, Stat_t* buf); /** * Converts Cygwin path to Win32 path. Uses dictionary container for diff --git a/Source/kwsys/testEncoding.cxx b/Source/kwsys/testEncoding.cxx index 03f2ec9..457e8a8 100644 --- a/Source/kwsys/testEncoding.cxx +++ b/Source/kwsys/testEncoding.cxx @@ -180,6 +180,88 @@ static int testCommandLineArguments() return status; } +static int testToWindowsExtendedPath() +{ +#ifdef _WIN32 + int ret = 0; + if (kwsys::Encoding::ToWindowsExtendedPath( + "L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") != + L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"" + << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath( + "L:/Local Mojo/Hex Power Pack/Iffy Voodoo") != + L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"L:/Local Mojo/Hex Power Pack/Iffy Voodoo\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath( + "\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") != + L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"" + << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath( + "//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo") != + L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo\"" + << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("//") != L"//") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"//\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\") != L"\\\\.\\") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"\\\\.\\\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\X") != L"\\\\.\\X") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"\\\\.\\X\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\X:") != L"\\\\?\\X:") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"\\\\.\\X:\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\X:\\") != + L"\\\\?\\X:\\") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"\\\\.\\X:\\\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("NUL") != L"\\\\.\\NUL") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"NUL\"" << std::endl; + ++ret; + } + + return ret; +#else + return 0; +#endif +} + //---------------------------------------------------------------------------- int testEncoding(int, char* []) { @@ -196,6 +278,7 @@ int testEncoding(int, char* []) ret |= testRobustEncoding(); ret |= testCommandLineArguments(); ret |= testWithNulls(); + ret |= testToWindowsExtendedPath(); return ret; } diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx index 8e1ea25..d11bcae 100644 --- a/Source/kwsys/testSystemTools.cxx +++ b/Source/kwsys/testSystemTools.cxx @@ -135,6 +135,19 @@ static bool CheckFileOperations() res = false; } + kwsys::SystemTools::Stat_t buf; + if (kwsys::SystemTools::Stat(testTxtFile.c_str(), &buf) != 0) { + std::cerr << "Problem with Stat - unable to stat text file: " + << testTxtFile << std::endl; + res = false; + } + + if (kwsys::SystemTools::Stat(testBinFile, &buf) != 0) { + std::cerr << "Problem with Stat - unable to stat bin file: " << testBinFile + << std::endl; + res = false; + } + if (!kwsys::SystemTools::MakeDirectory(testNewDir)) { std::cerr << "Problem with MakeDirectory for: " << testNewDir << std::endl; res = false; @@ -572,85 +585,6 @@ static bool CheckStringOperations() res = false; } -#ifdef _WIN32 - if (kwsys::SystemTools::ConvertToWindowsExtendedPath( - "L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") != - L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { - std::cerr << "Problem with ConvertToWindowsExtendedPath " - << "\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"" - << std::endl; - res = false; - } - - if (kwsys::SystemTools::ConvertToWindowsExtendedPath( - "L:/Local Mojo/Hex Power Pack/Iffy Voodoo") != - L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { - std::cerr << "Problem with ConvertToWindowsExtendedPath " - << "\"L:/Local Mojo/Hex Power Pack/Iffy Voodoo\"" << std::endl; - res = false; - } - - if (kwsys::SystemTools::ConvertToWindowsExtendedPath( - "\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") != - L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { - std::cerr << "Problem with ConvertToWindowsExtendedPath " - << "\"\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"" - << std::endl; - res = false; - } - - if (kwsys::SystemTools::ConvertToWindowsExtendedPath( - "//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo") != - L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { - std::cerr << "Problem with ConvertToWindowsExtendedPath " - << "\"//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo\"" - << std::endl; - res = false; - } - - if (kwsys::SystemTools::ConvertToWindowsExtendedPath("//") != L"//") { - std::cerr << "Problem with ConvertToWindowsExtendedPath " - << "\"//\"" << std::endl; - res = false; - } - - if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\") != - L"\\\\.\\") { - std::cerr << "Problem with ConvertToWindowsExtendedPath " - << "\"\\\\.\\\"" << std::endl; - res = false; - } - - if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X") != - L"\\\\.\\X") { - std::cerr << "Problem with ConvertToWindowsExtendedPath " - << "\"\\\\.\\X\"" << std::endl; - res = false; - } - - if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X:") != - L"\\\\?\\X:") { - std::cerr << "Problem with ConvertToWindowsExtendedPath " - << "\"\\\\.\\X:\"" << std::endl; - res = false; - } - - if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X:\\") != - L"\\\\?\\X:\\") { - std::cerr << "Problem with ConvertToWindowsExtendedPath " - << "\"\\\\.\\X:\\\"" << std::endl; - res = false; - } - - if (kwsys::SystemTools::ConvertToWindowsExtendedPath("NUL") != - L"\\\\.\\NUL") { - std::cerr << "Problem with ConvertToWindowsExtendedPath " - << "\"NUL\"" << std::endl; - res = false; - } - -#endif - if (kwsys::SystemTools::ConvertToWindowsOutputPath( "L://Local Mojo/Hex Power Pack/Iffy Voodoo") != "\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"") { diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 9b48b14..11978db 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -42,7 +42,7 @@ list(APPEND _cmake_options "-DTEST_LINK_DEPENDS=${TEST_LINK_DEPENDS}") list(APPEND _cmake_options "-DCMAKE_FORCE_DEPFILES=1") -if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^789]|[789][0-9])") +if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^89]|[89][0-9])") set(TEST_MULTI3 1) list(APPEND _cmake_options "-DTEST_MULTI3=1") endif() diff --git a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in index e2cdec8..b4c6fae4 100644 --- a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in +++ b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in @@ -1,5 +1,5 @@ #include <cmSystemTools.h> -#include <cmsys/Encoding.hxx> +#include "cmsys/Encoding.hxx" #include <string> #define RETVAL @_retval@ diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index 5d4ca70..46431bc 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -1,6 +1,6 @@ #include <cmConfigure.h> -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <iostream> #include <map> #include <stdlib.h> diff --git a/Tests/CMakeLib/testEncoding.cxx b/Tests/CMakeLib/testEncoding.cxx index 403c896..5e40638 100644 --- a/Tests/CMakeLib/testEncoding.cxx +++ b/Tests/CMakeLib/testEncoding.cxx @@ -1,9 +1,9 @@ -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <iostream> #include <string> #ifdef _WIN32 -#include <cmsys/ConsoleBuf.hxx> +#include "cmsys/ConsoleBuf.hxx" #endif #ifdef _WIN32 diff --git a/Tests/CMakeLib/testRST.cxx b/Tests/CMakeLib/testRST.cxx index e1b0903..8891276 100644 --- a/Tests/CMakeLib/testRST.cxx +++ b/Tests/CMakeLib/testRST.cxx @@ -3,7 +3,7 @@ #include "cmRST.h" #include "cmSystemTools.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <iostream> #include <string> diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 910ff39..60a2cbb 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -46,7 +46,7 @@ if(BUILD_TESTING) set(CMake_TEST_DEVENV "") if(CMAKE_VS_DEVENV_COMMAND) set(CMake_TEST_DEVENV "${CMAKE_VS_DEVENV_COMMAND}") - elseif(CMAKE_GENERATOR MATCHES "Visual Studio [7-9] " AND + elseif(CMAKE_GENERATOR MATCHES "Visual Studio [89] " AND NOT CMAKE_MAKE_PROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]") set(CMake_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}") endif() @@ -325,7 +325,7 @@ if(BUILD_TESTING) endif() endif() - if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^789]|[789][0-9])") + if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^89]|[89][0-9])") ADD_TEST_MACRO(CSharpOnly CSharpOnly) endif() @@ -477,6 +477,17 @@ if(BUILD_TESTING) ADD_TEST_MACRO(Module.CheckTypeSize CheckTypeSize) + set(Module.CheckIPOSupported-C_BUILD_OPTIONS -DCMake_TEST_IPO_WORKS_C=${CMake_TEST_IPO_WORKS_C}) + ADD_TEST_MACRO(Module.CheckIPOSupported-C CheckIPOSupported-C) + + set(Module.CheckIPOSupported-CXX_BUILD_OPTIONS -DCMake_TEST_IPO_WORKS_CXX=${CMake_TEST_IPO_WORKS_CXX}) + ADD_TEST_MACRO(Module.CheckIPOSupported-CXX CheckIPOSupported-CXX) + + if(CMAKE_Fortran_COMPILER) + set(Module.CheckIPOSupported-Fortran_BUILD_OPTIONS -DCMake_TEST_IPO_WORKS_Fortran=${CMake_TEST_IPO_WORKS_Fortran}) + ADD_TEST_MACRO(Module.CheckIPOSupported-Fortran CheckIPOSupported-Fortran) + endif() + add_test(Module.ExternalData ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Module/ExternalData" @@ -615,8 +626,8 @@ if(BUILD_TESTING) endif() # test for correct sub-project generation - # not implemented in VS 7.0, Xcode, or Ninja - if(NOT CMAKE_GENERATOR MATCHES "Visual Studio 7$|Xcode|Ninja") + # not implemented in Xcode or Ninja + if(NOT CMAKE_GENERATOR MATCHES "Xcode|Ninja") # run cmake and configure all of SubProject # but only build the independent executable car add_test(SubProject ${CMAKE_CTEST_COMMAND} @@ -1158,6 +1169,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators") + # This test runs a lot of processes. Do not make them compete + # for resources with other tests. + set_property(TEST CMakeTestAllGenerators PROPERTY RUN_SERIAL 1) endif() if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) @@ -1411,6 +1425,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindOpenSSL) endif() + if(CMake_TEST_FindMPI) + add_subdirectory(FindMPI) + endif() + if(CMake_TEST_FindPNG) add_subdirectory(FindPNG) endif() @@ -1924,7 +1942,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() if(MSVC AND NOT MSVC_VERSION LESS 1310 - AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7( |$)" AND (NOT CMAKE_GENERATOR MATCHES "Visual Studio [89]( |$)" OR CMAKE_SIZEOF_VOID_P EQUAL 4) ) @@ -1936,7 +1953,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ADD_TEST_MACRO(SBCS SBCS) endif() - if(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio [789]( |$)" + if(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio [89]( |$)" AND NOT CMAKE_GENERATOR_TOOLSET) ADD_TEST_MACRO(VSWindowsFormsResx VSWindowsFormsResx) endif() @@ -2135,7 +2152,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() endif() - if(CMAKE_GENERATOR MATCHES "Visual Studio ([^789]|[789][0-9])" AND nasm) + if(CMAKE_GENERATOR MATCHES "Visual Studio ([^89]|[89][0-9])" AND nasm) ADD_TEST_MACRO(VSNASM VSNASM) endif() diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt index 2b25766..c84fa74 100644 --- a/Tests/CMakeOnly/CMakeLists.txt +++ b/Tests/CMakeOnly/CMakeLists.txt @@ -33,7 +33,7 @@ add_CMakeOnly_test(CompilerIdCXX) if(CMAKE_Fortran_COMPILER) add_CMakeOnly_test(CompilerIdFortran) endif() -if(CMAKE_GENERATOR MATCHES "Visual Studio ([^789]|[789][0-9])") +if(CMAKE_GENERATOR MATCHES "Visual Studio ([^89]|[89][0-9])") add_CMakeOnly_test(CompilerIdCSharp) endif() diff --git a/Tests/CMakeTestAllGenerators/RunCMake.cmake b/Tests/CMakeTestAllGenerators/RunCMake.cmake index 6d27d3b..bfbb3a5 100644 --- a/Tests/CMakeTestAllGenerators/RunCMake.cmake +++ b/Tests/CMakeTestAllGenerators/RunCMake.cmake @@ -9,42 +9,23 @@ endif() # Analyze 'cmake --help' output for list of available generators: # execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${dir}) -execute_process(COMMAND ${CMAKE_COMMAND} --help +execute_process(COMMAND ${CMAKE_COMMAND} -E capabilities RESULT_VARIABLE result OUTPUT_VARIABLE stdout ERROR_VARIABLE stderr WORKING_DIRECTORY ${dir}) -string(REPLACE ";" "\\;" stdout "${stdout}") -string(REPLACE "\n" "E;" stdout "${stdout}") - -set(collecting 0) set(generators) -foreach(eline ${stdout}) - string(REGEX REPLACE "^(.*)E$" "\\1" line "${eline}") - if(collecting AND NOT line STREQUAL "") - if(line MATCHES "=") - string(REGEX REPLACE "^ (.+)= (.*)$" "\\1" gen "${line}") - if(gen MATCHES "[A-Za-z]") - string(REGEX REPLACE "^(.*[^ ]) +$" "\\1" gen "${gen}") - if(gen) - set(generators ${generators} ${gen}) - endif() - endif() - else() - if(line MATCHES "^ [A-Za-z0-9]") - string(REGEX REPLACE "^ (.+)$" "\\1" gen "${line}") - string(REGEX REPLACE "^(.*[^ ]) +$" "\\1" gen "${gen}") - if(gen) - set(generators ${generators} ${gen}) - endif() - endif() +string(REGEX MATCHALL [["name":"[^"]+","platformSupport"]] generators_json "${stdout}") +foreach(gen_json IN LISTS generators_json) + if("${gen_json}" MATCHES [["name":"([^"]+)"]]) + set(gen "${CMAKE_MATCH_1}") + if(NOT gen MATCHES " (Win64|IA64|ARM)$") + list(APPEND generators "${gen}") endif() endif() - if(line STREQUAL "The following generators are available on this platform:") - set(collecting 1) - endif() endforeach() +list(REMOVE_DUPLICATES generators) # Also call with one non-existent generator: # @@ -60,28 +41,6 @@ message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)") message(STATUS "CMake generators='${generators}'") -# If we'll be testing any of the MinGW Makefiles generators, adjust the -# ENV{PATH} to make sure libgmp-10.dll can be loaded as needed. But only if -# the testing machine has a default MinGW install... (If you have a -# non-default install, append to the PATH before running the test...) -# -if(generators MATCHES "MinGW Makefiles") - if(EXISTS "C:/MinGW/bin/libgmp-10.dll") - string(TOLOWER "$ENV{PATH}" path) - if(NOT path MATCHES "/mingw/bin") - if(UNIX) - set(sep ":") - set(mingw_bin "/mingw/bin") - else() - set(sep ";") - set(mingw_bin "C:/MinGW/bin") - endif() - set(ENV{PATH} "$ENV{PATH}${sep}${mingw_bin}") - message(STATUS "info: appending '${sep}${mingw_bin}' to the PATH") - endif() - endif() -endif() - # First setup a source tree to run CMake on. # execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index f504c7b..eeae3f0 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -79,6 +79,15 @@ set_property(TARGET testLib7 PROPERTY OUTPUT_NAME_DEBUG testLib7D-$<CONFIG>) set_property(TARGET testLib7 PROPERTY OUTPUT_NAME_RELEASE testLib7R-$<CONFIG>) set_property(TARGET testLib7 PROPERTY OUTPUT_NAME testLib7-$<CONFIG>) +# Test exporting OBJECT targets +add_library(testLib8 OBJECT testLib8A.c testLib8B.c sub/testLib8C.c) + +if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]") + set(maybe_testLib8 testLib8) +else() + set(maybe_testLib8 "") +endif() + # Test using the target_link_libraries command to set the # LINK_INTERFACE_LIBRARIES* properties. We construct two libraries # providing the same two symbols. In each library one of the symbols @@ -474,7 +483,7 @@ install( TARGETS testExe1 testLib1 testLib2 testExe2 testLib3 testLib4 testExe3 testExe4 testExe2lib testLib4lib testLib4libdbg testLib4libopt - testLib6 testLib7 + testLib6 testLib7 ${maybe_testLib8} testLibCycleA testLibCycleB testLibNoSONAME cmp0022NEW cmp0022OLD @@ -483,6 +492,7 @@ install( RUNTIME DESTINATION $<1:bin> LIBRARY DESTINATION $<1:lib> NAMELINK_SKIP ARCHIVE DESTINATION $<1:lib> + OBJECTS DESTINATION $<1:lib> FRAMEWORK DESTINATION Frameworks BUNDLE DESTINATION Applications ) @@ -535,6 +545,7 @@ export(TARGETS testExe1 testLib1 testLib2 testLib3 FILE ExportBuildTree.cmake ) export(TARGETS testExe2 testLib4 testLib5 testLib6 testLib7 testExe3 testExe4 testExe2lib + ${maybe_testLib8} testLib4lib testLib4libdbg testLib4libopt testLibCycleA testLibCycleB testLibNoSONAME diff --git a/Tests/ExportImport/Export/sub/testLib8C.c b/Tests/ExportImport/Export/sub/testLib8C.c new file mode 100644 index 0000000..a5568c7 --- /dev/null +++ b/Tests/ExportImport/Export/sub/testLib8C.c @@ -0,0 +1,4 @@ +int testLib8C(void) +{ + return 0; +} diff --git a/Tests/ExportImport/Export/testLib8A.c b/Tests/ExportImport/Export/testLib8A.c new file mode 100644 index 0000000..c64655a --- /dev/null +++ b/Tests/ExportImport/Export/testLib8A.c @@ -0,0 +1,4 @@ +int testLib8A(void) +{ + return 0; +} diff --git a/Tests/ExportImport/Export/testLib8B.c b/Tests/ExportImport/Export/testLib8B.c new file mode 100644 index 0000000..1be6c9c --- /dev/null +++ b/Tests/ExportImport/Export/testLib8B.c @@ -0,0 +1,4 @@ +int testLib8B(void) +{ + return 0; +} diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 5ce9628..01960ea 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -228,6 +228,16 @@ target_link_libraries(imp_lib1 exp_testLib2) add_library(imp_lib1b STATIC imp_lib1.c) target_link_libraries(imp_lib1b bld_testLib2) +if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]") + # Create a executable that is using objects imported from the install tree + add_executable(imp_testLib8 imp_testLib8.c $<TARGET_OBJECTS:exp_testLib8>) + + if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT XCODE_VERSION VERSION_LESS 5) + # Create a executable that is using objects imported from the build tree + add_executable(imp_testLib8b imp_testLib8.c $<TARGET_OBJECTS:bld_testLib8>) + endif() +endif() + #----------------------------------------------------------------------------- # Test that handling imported targets, including transitive dependencies, # works in CheckFunctionExists (...and hopefully all other try_compile() checks diff --git a/Tests/ExportImport/Import/A/imp_testExe1.c b/Tests/ExportImport/Import/A/imp_testExe1.c index 83a9bb5..3488439 100644 --- a/Tests/ExportImport/Import/A/imp_testExe1.c +++ b/Tests/ExportImport/Import/A/imp_testExe1.c @@ -1,15 +1,15 @@ -extern int generated_by_testExe1(); -extern int generated_by_testExe3(); -extern int generated_by_testExe4(); -extern int testLib2(); -extern int testLib3(); -extern int testLib4(); -extern int testLib4lib(); -extern int testLib5(); -extern int testLib6(); -extern int testLib7(); -extern int testLibCycleA1(); -extern int testLibPerConfigDest(); +extern int generated_by_testExe1(void); +extern int generated_by_testExe3(void); +extern int generated_by_testExe4(void); +extern int testLib2(void); +extern int testLib3(void); +extern int testLib4(void); +extern int testLib4lib(void); +extern int testLib5(void); +extern int testLib6(void); +extern int testLib7(void); +extern int testLibCycleA1(void); +extern int testLibPerConfigDest(void); /* Switch a symbol between debug and optimized builds to make sure the proper library is found from the testLib4 link interface. */ diff --git a/Tests/ExportImport/Import/A/imp_testLib8.c b/Tests/ExportImport/Import/A/imp_testLib8.c new file mode 100644 index 0000000..2749b17 --- /dev/null +++ b/Tests/ExportImport/Import/A/imp_testLib8.c @@ -0,0 +1,8 @@ + +int testLib8A(void); +int testLib8B(void); + +int main() +{ + return (testLib8A() + testLib8B()); +} diff --git a/Tests/FindMPI/CMakeLists.txt b/Tests/FindMPI/CMakeLists.txt new file mode 100644 index 0000000..121d978 --- /dev/null +++ b/Tests/FindMPI/CMakeLists.txt @@ -0,0 +1,21 @@ +foreach(c C CXX Fortran) + if(CMake_TEST_FindMPI_${c}) + set(CMake_TEST_FindMPI_FLAG_${c} 1) + else() + set(CMake_TEST_FindMPI_FLAG_${c} 0) + endif() +endforeach() + +add_test(NAME FindMPI.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindMPI/Test" + "${CMake_BINARY_DIR}/Tests/FindMPI/Test" + ${build_generator_args} + --build-project TestFindMPI + --build-options ${build_options} + -DMPI_TEST_C=${CMake_TEST_FindMPI_FLAG_C} + -DMPI_TEST_CXX=${CMake_TEST_FindMPI_FLAG_CXX} + -DMPI_TEST_Fortran=${CMake_TEST_FindMPI_FLAG_Fortran} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindMPI/Test/CMakeLists.txt b/Tests/FindMPI/Test/CMakeLists.txt new file mode 100644 index 0000000..6f177f9 --- /dev/null +++ b/Tests/FindMPI/Test/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.8) +project(TestFindMPI) +include(CTest) + +macro(source_code_mapper_helper LANG_NAME) + if("${LANG_NAME}" STREQUAL "C") + set(MPITEST_SOURCE_FILE "main.c") + elseif("${LANG_NAME}" STREQUAL "CXX") + configure_file("main.c" "main.cxx" COPYONLY) + set(MPITEST_SOURCE_FILE "main.cxx") + elseif("${LANG_NAME}" STREQUAL "Fortran") + set(MPITEST_SOURCE_FILE "main.f90") + endif() +endmacro() + +foreach(c C CXX Fortran) + if("${MPI_TEST_${c}}") + message("Testing ${c}") + enable_language(${c}) + endif() +endforeach() + +find_package(MPI REQUIRED) + +foreach(c C CXX Fortran) + if(NOT "${MPI_TEST_${c}}") + continue() + endif() + source_code_mapper_helper(${c}) + add_executable(test_tgt_${c} ${MPITEST_SOURCE_FILE}) + target_link_libraries(test_tgt_${c} MPI::MPI_${c}) + add_test(NAME test_tgt_${c} COMMAND test_tgt_${c}) + + add_executable(test_var_${c} ${MPITEST_SOURCE_FILE}) + target_include_directories(test_var_${c} PRIVATE "${MPI_${c}_INCLUDE_PATH}") + target_link_libraries(test_var_${c} PRIVATE "${MPI_${c}_LINK_FLAGS}" "${MPI_${c}_LIBRARIES}") + set(copied_MPI_${c}_OPTIONS "${MPI_${c}_COMPILE_FLAGS}") + separate_arguments(copied_MPI_${c}_OPTIONS) + target_compile_options(test_var_${c} PRIVATE "${copied_MPI_${c}_OPTIONS}") + add_test(NAME test_var_${c} COMMAND test_var_${c}) +endforeach() diff --git a/Tests/FindMPI/Test/main.c b/Tests/FindMPI/Test/main.c new file mode 100644 index 0000000..7b7f175 --- /dev/null +++ b/Tests/FindMPI/Test/main.c @@ -0,0 +1,7 @@ +#include <mpi.h> + +int main(int argc, char** argv) +{ + MPI_Init(&argc, &argv); + MPI_Finalize(); +} diff --git a/Tests/FindMPI/Test/main.f90 b/Tests/FindMPI/Test/main.f90 new file mode 100644 index 0000000..6fb6fd3 --- /dev/null +++ b/Tests/FindMPI/Test/main.f90 @@ -0,0 +1,7 @@ +program mpi_test + include 'mpif.h' + integer ierror + + call MPI_INIT(ierror) + call MPI_FINALIZE(ierror) +end program mpi_test diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index adc87cd..8ac3419 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -292,3 +292,19 @@ set(CMP0044_TYPE NEW) add_subdirectory(CMP0044 ${CMAKE_BINARY_DIR}/CMP0044-NEW) set(CMP0044_TYPE OLD) add_subdirectory(CMP0044 ${CMAKE_BINARY_DIR}/CMP0044-OLD) + +if(NOT CMAKE_GENERATOR STREQUAL Xcode OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]") + add_library(objlib OBJECT objlib1.c objlib2.c) + file(GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/objlib_files_$<CONFIGURATION>" + CONTENT "$<JOIN:$<TARGET_OBJECTS:objlib>,\n>\n" + ) + + add_custom_target(check_object_files ALL + COMMAND ${CMAKE_COMMAND} + "-DOBJLIB_LISTFILE=${CMAKE_CURRENT_BINARY_DIR}/objlib_files_$<CONFIGURATION>" + -DEXPECTED_NUM_OBJECTFILES=2 + -P "${CMAKE_CURRENT_SOURCE_DIR}/check_object_files.cmake" + DEPENDS objlib + ) +endif() diff --git a/Tests/GeneratorExpression/check_object_files.cmake b/Tests/GeneratorExpression/check_object_files.cmake new file mode 100644 index 0000000..cfccd29 --- /dev/null +++ b/Tests/GeneratorExpression/check_object_files.cmake @@ -0,0 +1,26 @@ + +if (NOT EXISTS ${OBJLIB_LISTFILE}) + message(SEND_ERROR "Object listing file \"${OBJLIB_LISTFILE}\" not found!") +endif() + +file(STRINGS ${OBJLIB_LISTFILE} objlib_files ENCODING UTF-8) + +list(LENGTH objlib_files num_objectfiles) +if (NOT EXPECTED_NUM_OBJECTFILES EQUAL num_objectfiles) + message(SEND_ERROR "Unexpected number of entries in object list file (${num_objectfiles} instead of ${EXPECTED_NUM_OBJECTFILES})") +endif() + +foreach(objlib_file ${objlib_files}) + set(file_exists False) + if (EXISTS ${objlib_file}) + set(file_exists True) + endif() + + if (NOT file_exists) + if(attempts) + list(REMOVE_DUPLICATES attempts) + set(tried " Tried ${attempts}") + endif() + message(SEND_ERROR "File \"${objlib_file}\" does not exist!${tried}") + endif() +endforeach() diff --git a/Tests/GeneratorExpression/objlib1.c b/Tests/GeneratorExpression/objlib1.c new file mode 100644 index 0000000..98a95a4 --- /dev/null +++ b/Tests/GeneratorExpression/objlib1.c @@ -0,0 +1,4 @@ + +void objlib1() +{ +} diff --git a/Tests/GeneratorExpression/objlib2.c b/Tests/GeneratorExpression/objlib2.c new file mode 100644 index 0000000..b2c1050 --- /dev/null +++ b/Tests/GeneratorExpression/objlib2.c @@ -0,0 +1,4 @@ + +void objlib2() +{ +} diff --git a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt new file mode 100644 index 0000000..607dcd3 --- /dev/null +++ b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.8) +project(CheckIPOSupported-C LANGUAGES C) + +cmake_policy(SET CMP0069 NEW) + +include(CheckIPOSupported) +check_ipo_supported(RESULT ipo_supported) +if(ipo_supported) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) +elseif(CMake_TEST_IPO_WORKS_C) + message(FATAL_ERROR "IPO expected to work") +endif() + +add_library(foo foo.c) +add_executable(CheckIPOSupported-C main.c) +target_link_libraries(CheckIPOSupported-C PUBLIC foo) + +enable_testing() +add_test(NAME CheckIPOSupported-C COMMAND CheckIPOSupported-C) diff --git a/Tests/Module/CheckIPOSupported-C/foo.c b/Tests/Module/CheckIPOSupported-C/foo.c new file mode 100644 index 0000000..1e56597 --- /dev/null +++ b/Tests/Module/CheckIPOSupported-C/foo.c @@ -0,0 +1,4 @@ +int foo() +{ + return 0x42; +} diff --git a/Tests/Module/CheckIPOSupported-C/main.c b/Tests/Module/CheckIPOSupported-C/main.c new file mode 100644 index 0000000..99204ab --- /dev/null +++ b/Tests/Module/CheckIPOSupported-C/main.c @@ -0,0 +1,9 @@ +int foo(); + +int main() +{ + if (foo() == 0) { + return 1; + } + return 0; +} diff --git a/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt new file mode 100644 index 0000000..2dede93 --- /dev/null +++ b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.8) +project(CheckIPOSupported-CXX LANGUAGES CXX) + +cmake_policy(SET CMP0069 NEW) + +include(CheckIPOSupported) +check_ipo_supported(RESULT ipo_supported) +if(ipo_supported) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) +elseif(CMake_TEST_IPO_WORKS_CXX) + message(FATAL_ERROR "IPO expected to work") +endif() + +add_library(foo foo.cpp) +add_executable(CheckIPOSupported-CXX main.cpp) +target_link_libraries(CheckIPOSupported-CXX PUBLIC foo) + +enable_testing() +add_test(NAME CheckIPOSupported-CXX COMMAND CheckIPOSupported-CXX) diff --git a/Tests/Module/CheckIPOSupported-CXX/foo.cpp b/Tests/Module/CheckIPOSupported-CXX/foo.cpp new file mode 100644 index 0000000..1e56597 --- /dev/null +++ b/Tests/Module/CheckIPOSupported-CXX/foo.cpp @@ -0,0 +1,4 @@ +int foo() +{ + return 0x42; +} diff --git a/Tests/Module/CheckIPOSupported-CXX/main.cpp b/Tests/Module/CheckIPOSupported-CXX/main.cpp new file mode 100644 index 0000000..99204ab --- /dev/null +++ b/Tests/Module/CheckIPOSupported-CXX/main.cpp @@ -0,0 +1,9 @@ +int foo(); + +int main() +{ + if (foo() == 0) { + return 1; + } + return 0; +} diff --git a/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt b/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt new file mode 100644 index 0000000..dee5c25 --- /dev/null +++ b/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.8) +project(CheckIPOSupported-Fortran LANGUAGES Fortran) + +cmake_policy(SET CMP0069 NEW) + +include(CheckIPOSupported) +check_ipo_supported(RESULT ipo_supported) +if(ipo_supported) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) +elseif(CMake_TEST_IPO_WORKS_Fortran) + message(FATAL_ERROR "IPO expected to work") +endif() + +add_library(foo foo.f) +add_executable(CheckIPOSupported-Fortran main.f) +target_link_libraries(CheckIPOSupported-Fortran PUBLIC foo) + +enable_testing() +add_test(NAME CheckIPOSupported-Fortran COMMAND CheckIPOSupported-Fortran) diff --git a/Tests/Module/CheckIPOSupported-Fortran/foo.f b/Tests/Module/CheckIPOSupported-Fortran/foo.f new file mode 100644 index 0000000..945d2d5 --- /dev/null +++ b/Tests/Module/CheckIPOSupported-Fortran/foo.f @@ -0,0 +1,2 @@ + SUBROUTINE FOO + END diff --git a/Tests/Module/CheckIPOSupported-Fortran/main.f b/Tests/Module/CheckIPOSupported-Fortran/main.f new file mode 100644 index 0000000..9d1de9f --- /dev/null +++ b/Tests/Module/CheckIPOSupported-Fortran/main.f @@ -0,0 +1,3 @@ + PROGRAM BOO + CALL FOO() + END diff --git a/Tests/ObjectLibrary/CMakeLists.txt b/Tests/ObjectLibrary/CMakeLists.txt index e3476df..4bffd12 100644 --- a/Tests/ObjectLibrary/CMakeLists.txt +++ b/Tests/ObjectLibrary/CMakeLists.txt @@ -16,11 +16,7 @@ add_custom_command(TARGET UseCshared POST_BUILD COMMAND ${CMAKE_COMMAND} -P ${CM add_executable(UseCinternal main.c c.c $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:B>) -if("${CMAKE_GENERATOR}" MATCHES "^Visual Studio (7|7 .NET 2003)$") - # VS 7 generators do not add objects as sources so we need a - # dummy object to convince the IDE to build the targets below. - set(dummy dummy.obj) # In MinGW: gcc -c dummy.c -o dummy.obj -elseif("${CMAKE_GENERATOR}" MATCHES "Xcode") +if("${CMAKE_GENERATOR}" MATCHES "Xcode") # Xcode does not seem to support targets without sources. set(dummy dummy.c) endif() diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index 807a427..8c2cdc9 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -25,9 +25,6 @@ endif() if("${CMAKE_GENERATOR}" MATCHES "Watcom WMake") set(PP_WATCOM 1) endif() -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 7$") - set(PP_VS70 1) -endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") set(PP_VS 1) endif() @@ -46,14 +43,11 @@ endif() # must not have it escaped inside the configured header. set(STRING_EXTRA "") -if(NOT BORLAND AND NOT PP_VS70) - # Borland, VS70 IDE: ; +if(NOT BORLAND) + # Borland: ; # The Borland compiler will simply not accept a non-escaped semicolon # on the command line. If it is escaped \; then the escape character # shows up in the preprocessing output too. - # - # The VS 7.0 IDE separates definitions on semicolons and commas with - # no regard for quotes. Fortunately VS 7.1 and above are okay. set(SEMICOLON "\;") endif() diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake index ffd3ae1..67a6101 100644 --- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake @@ -31,7 +31,7 @@ function(run_BuildDepends CASE) endfunction() run_BuildDepends(C-Exe) -if(NOT RunCMake_GENERATOR MATCHES "Visual Studio 7|Xcode") +if(NOT RunCMake_GENERATOR STREQUAL "Xcode") if(RunCMake_GENERATOR MATCHES "Visual Studio 10") # VS 10 forgets to re-link when a manifest changes set(run_BuildDepends_skip_step_2 1) diff --git a/Tests/RunCMake/CMP0026/CMP0026-OLD.cmake b/Tests/RunCMake/CMP0026/CMP0026-OLD.cmake new file mode 100644 index 0000000..80497a3 --- /dev/null +++ b/Tests/RunCMake/CMP0026/CMP0026-OLD.cmake @@ -0,0 +1,12 @@ +enable_language(CXX) + +cmake_policy(SET CMP0026 OLD) + +set(out ${CMAKE_CURRENT_BINARY_DIR}/out.txt) + +add_library(somelib empty.cpp ${out}) +get_target_property(_loc somelib LOCATION) + +file(WRITE "${out}" + "source file written by project code after getting target LOCATION\n" + ) diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake index 6331717..047da28 100644 --- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake @@ -1,6 +1,7 @@ include(RunCMake) run_cmake(CMP0026-WARN) +run_cmake(CMP0026-OLD) run_cmake(CMP0026-NEW) run_cmake(CMP0026-IMPORTED) run_cmake(CMP0026-CONFIG-LOCATION-NEW) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 73a4965..32c4be8 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -270,13 +270,13 @@ endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") add_RunCMake_test(include_external_msproject) - if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([789]|10)" AND NOT CMAKE_VS_DEVENV_COMMAND) + if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([89]|10)" AND NOT CMAKE_VS_DEVENV_COMMAND) set(NO_USE_FOLDERS 1) endif() add_RunCMake_test(VSSolution -DNO_USE_FOLDERS=${NO_USE_FOLDERS}) endif() -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^789]|[789][0-9])") +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^89]|[89][0-9])") add_RunCMake_test(VS10Project) endif() diff --git a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON-stderr.txt deleted file mode 100644 index 2cb01ff..0000000 --- a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Warning: - The "Visual Studio 7 .NET 2003" generator is deprecated and will be removed - in a future version of CMake. - - Add CMAKE_WARN_VS71=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index b213ee2..f327f78 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -78,13 +78,6 @@ if(RunCMake_GENERATOR STREQUAL "Ninja") unset(RunCMake_TEST_NO_CLEAN) endif() -if(RunCMake_GENERATOR STREQUAL "Visual Studio 7 .NET 2003") - set(RunCMake_WARN_VS71 1) - run_cmake(DeprecateVS71-WARN-ON) - unset(RunCMake_WARN_VS71) - run_cmake(DeprecateVS71-WARN-OFF) -endif() - if(UNIX) run_cmake_command(E_create_symlink-no-arg ${CMAKE_COMMAND} -E create_symlink diff --git a/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt index 0abb7df..a242180 100644 --- a/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt +++ b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt @@ -1,5 +1,6 @@ CMake Error in CMakeLists.txt: - Evaluation file to be written multiple times for different configurations - or languages with different content: + Evaluation file to be written multiple times with different content. This + is generally caused by the content evaluating the configuration type, + language, or location of object files: .*output.txt diff --git a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt index d3aa973..b08ef5a 100644 --- a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt +++ b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt @@ -1,9 +1,8 @@ -CMake Error at OutputNameMatchesObjects.cmake:2 \(file\): +CMake Error at OutputNameMatchesObjects.cmake:[0-9]+ \(file\): Error evaluating generator expression: \$<TARGET_OBJECTS:foo> - The evaluation of the TARGET_OBJECTS generator expression is only suitable - for consumption by CMake. It is not suitable for writing out elsewhere. + Objects of target "foo" referenced but is not an OBJECT library. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake index d807450..daa7c49 100644 --- a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake +++ b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake @@ -1,3 +1,4 @@ +enable_language(CXX) file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<BOOL:$<TARGET_OBJECTS:foo>>somefile.cpp" diff --git a/Tests/RunCMake/ObjectLibrary/Export-stderr.txt b/Tests/RunCMake/ObjectLibrary/Export-stderr.txt deleted file mode 100644 index bdadca4..0000000 --- a/Tests/RunCMake/ObjectLibrary/Export-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Error at Export.cmake:2 \(export\): - export given OBJECT library "A" which may not be exported. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetObjects/BadContext-result.txt b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/TargetObjects/BadContext-result.txt +++ b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-result.txt diff --git a/Tests/RunCMake/ObjectLibrary/ExportNotSupported-stderr.txt b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-stderr.txt new file mode 100644 index 0000000..5420159 --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at ExportNotSupported.cmake:[0-9]+ \(export\): + export given OBJECT library "A" which may not be exported under Xcode with + multiple architectures. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/ExportNotSupported.cmake b/Tests/RunCMake/ObjectLibrary/ExportNotSupported.cmake new file mode 100644 index 0000000..a3f104e --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/ExportNotSupported.cmake @@ -0,0 +1,2 @@ +add_library(A OBJECT a.c) +export(TARGETS A FILE AExport.cmake) diff --git a/Tests/RunCMake/ObjectLibrary/Import.cmake b/Tests/RunCMake/ObjectLibrary/Import.cmake index 806b44a..42f4468 100644 --- a/Tests/RunCMake/ObjectLibrary/Import.cmake +++ b/Tests/RunCMake/ObjectLibrary/Import.cmake @@ -1 +1,12 @@ + add_library(A OBJECT IMPORTED) + +# We don't actually build this example so just configure dummy +# object files to test. They do not have to exist. +set_property(TARGET A APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) +set_target_properties(A PROPERTIES + IMPORTED_OBJECTS_DEBUG "${CMAKE_CURRENT_BINARY_DIR}/does_not_exist.o" + IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/does_not_exist.o" + ) + +add_library(B $<TARGET_OBJECTS:A> b.c) diff --git a/Tests/RunCMake/ObjectLibrary/Install-result.txt b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/ObjectLibrary/Install-result.txt +++ b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-result.txt diff --git a/Tests/RunCMake/ObjectLibrary/Import-stderr.txt b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-stderr.txt index 74b496a..0fadac2 100644 --- a/Tests/RunCMake/ObjectLibrary/Import-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-stderr.txt @@ -1,4 +1,5 @@ -CMake Error at Import.cmake:1 \(add_library\): - The OBJECT library type may not be used for IMPORTED libraries. +CMake Error at ImportNotSupported.cmake:[0-9]+ \(add_library\): + The OBJECT library type may not be used for IMPORTED libraries under Xcode + with multiple architectures. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake b/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake new file mode 100644 index 0000000..806b44a --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake @@ -0,0 +1 @@ +add_library(A OBJECT IMPORTED) diff --git a/Tests/RunCMake/ObjectLibrary/Import-result.txt b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/ObjectLibrary/Import-result.txt +++ b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-result.txt diff --git a/Tests/RunCMake/ObjectLibrary/Install-stderr.txt b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-stderr.txt index d2f9f4a..35a0e4f 100644 --- a/Tests/RunCMake/ObjectLibrary/Install-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-stderr.txt @@ -1,4 +1,5 @@ -CMake Error at Install.cmake:2 \(install\): - install TARGETS given OBJECT library "A" which may not be installed. +CMake Error at InstallNotSupported.cmake:[0-9]+ \(install\): + install TARGETS given OBJECT library "A" which may not be installed under + Xcode with multiple architectures. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/InstallNotSupported.cmake b/Tests/RunCMake/ObjectLibrary/InstallNotSupported.cmake new file mode 100644 index 0000000..c1d214b --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/InstallNotSupported.cmake @@ -0,0 +1,2 @@ +add_library(A OBJECT a.c) +install(TARGETS A DESTINATION lib) diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake index e932693..fe708ce 100644 --- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake +++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake @@ -5,9 +5,15 @@ run_cmake(BadSourceExpression2) run_cmake(BadSourceExpression3) run_cmake(BadObjSource1) run_cmake(BadObjSource2) -run_cmake(Export) -run_cmake(Import) -run_cmake(Install) +if(RunCMake_GENERATOR STREQUAL "Xcode" AND "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]") + run_cmake(ExportNotSupported) + run_cmake(ImportNotSupported) + run_cmake(InstallNotSupported) +else() + run_cmake(Export) + run_cmake(Import) + run_cmake(Install) +endif() run_cmake(LinkObjLHS) run_cmake(LinkObjRHS1) run_cmake(LinkObjRHS2) diff --git a/Tests/RunCMake/ObjectLibrary/b.c b/Tests/RunCMake/ObjectLibrary/b.c new file mode 100644 index 0000000..6751907 --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/b.c @@ -0,0 +1,4 @@ +int b(void) +{ + return 0; +} diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 9e2fe7a..04eadd5 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -51,9 +51,6 @@ function(run_cmake test) if(APPLE) list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW) endif() - if(RunCMake_GENERATOR STREQUAL "Visual Studio 7 .NET 2003" AND NOT RunCMake_WARN_VS71) - list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS71=OFF) - endif() if(RunCMake_MAKE_PROGRAM) list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}") endif() diff --git a/Tests/RunCMake/TargetObjects/BadContext-stderr.txt b/Tests/RunCMake/TargetObjects/BadContext-stderr.txt deleted file mode 100644 index b78189e..0000000 --- a/Tests/RunCMake/TargetObjects/BadContext-stderr.txt +++ /dev/null @@ -1,27 +0,0 @@ -(CMake Error at BadContext.cmake:4 \(file\): - Error evaluating generator expression: - - \$<TARGET_OBJECTS:NoTarget> - - The evaluation of the TARGET_OBJECTS generator expression is only suitable - for consumption by CMake. It is not suitable for writing out elsewhere. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -*)+ -(CMake Error at BadContext.cmake:5 \(file\): - Error evaluating generator expression: - - \$<TARGET_OBJECTS:NoTarget> - - The evaluation of the TARGET_OBJECTS generator expression is only suitable - for consumption by CMake. It is not suitable for writing out elsewhere. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -*)+ -CMake Error: - Error evaluating generator expression: - - \$<TARGET_OBJECTS:NoTarget> - - The evaluation of the TARGET_OBJECTS generator expression is only suitable - for consumption by CMake. It is not suitable for writing out elsewhere. diff --git a/Tests/RunCMake/ObjectLibrary/Export-result.txt b/Tests/RunCMake/TargetObjects/NoTarget-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/ObjectLibrary/Export-result.txt +++ b/Tests/RunCMake/TargetObjects/NoTarget-result.txt diff --git a/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt b/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt new file mode 100644 index 0000000..eadccaf --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt @@ -0,0 +1,24 @@ +(CMake Error at NoTarget.cmake:4 \(file\): + Error evaluating generator expression: + + \$<TARGET_OBJECTS:NoTarget> + + Objects of target "NoTarget" referenced but no such target exists. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +*)+ +(CMake Error at NoTarget.cmake:5 \(file\): + Error evaluating generator expression: + + \$<TARGET_OBJECTS:NoTarget> + + Objects of target "NoTarget" referenced but no such target exists. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +*)+ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_OBJECTS:NoTarget> + + Objects of target "NoTarget" referenced but no such target exists. diff --git a/Tests/RunCMake/TargetObjects/BadContext.cmake b/Tests/RunCMake/TargetObjects/NoTarget.cmake index 5d7e33e..5d7e33e 100644 --- a/Tests/RunCMake/TargetObjects/BadContext.cmake +++ b/Tests/RunCMake/TargetObjects/NoTarget.cmake diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt b/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt b/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt new file mode 100644 index 0000000..a66794c --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NotObjlibTarget.cmake:3 \(file\): + Error evaluating generator expression: + + \$<TARGET_OBJECTS:StaticLib> + + Objects of target "StaticLib" referenced but is not an OBJECT library. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake new file mode 100644 index 0000000..8e5fdd0 --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake @@ -0,0 +1,3 @@ +add_library(StaticLib empty.cpp) + +file(GENERATE OUTPUT test_output CONTENT $<TARGET_OBJECTS:StaticLib>) diff --git a/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake index 85c76e2..30b9fee 100644 --- a/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake +++ b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake @@ -1,3 +1,4 @@ include(RunCMake) -run_cmake(BadContext) +run_cmake(NoTarget) +run_cmake(NotObjlibTarget) diff --git a/Tests/RunCMake/TargetObjects/empty.cpp b/Tests/RunCMake/TargetObjects/empty.cpp new file mode 100644 index 0000000..4086dcc --- /dev/null +++ b/Tests/RunCMake/TargetObjects/empty.cpp @@ -0,0 +1,4 @@ +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake index 4ec3e3b..3a04db4 100644 --- a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake +++ b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake @@ -12,6 +12,6 @@ run_cmake(StartupProject) run_cmake(StartupProjectMissing) run_cmake(AddPackageToDefault) -if(RunCMake_GENERATOR MATCHES "Visual Studio ([^7]|[7][0-9])" AND NOT NO_USE_FOLDERS) +if(NOT NO_USE_FOLDERS) run_cmake(StartupProjectUseFolders) endif() diff --git a/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-result.txt b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-stderr.txt b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-stderr.txt new file mode 100644 index 0000000..9d5f876 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad-stderr.txt @@ -0,0 +1,15 @@ +^CMake Error at INSTALL-FILES_FROM_DIR-bad.cmake:[0-9]+ \(file\): + file option FILES_FROM_DIR requires all files to be specified as relative + paths\. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at INSTALL-FILES_FROM_DIR-bad.cmake:[0-9]+ \(file\): + file INSTALL option RENAME may not be combined with FILES_FROM_DIR\. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at INSTALL-FILES_FROM_DIR-bad.cmake:[0-9]+ \(file\): + file option FILES_FROM_DIR may not appear after PATTERN or REGEX\. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad.cmake b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad.cmake new file mode 100644 index 0000000..807b704 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-bad.cmake @@ -0,0 +1,5 @@ +set(src ${CMAKE_CURRENT_SOURCE_DIR}/from) +set(dst ${CMAKE_CURRENT_BINARY_DIR}/from) +file(INSTALL FILES ${src}/a.txt FILES_FROM_DIR ${src} DESTINATION ${dst}) +file(INSTALL FILES a.txt FILES_FROM_DIR ${src} DESTINATION ${dst} RENAME b.txt) +file(INSTALL FILES a.txt DESTINATION ${dst} PATTERN *.txt FILES_FROM_DIR) diff --git a/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-stdout.txt b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-stdout.txt new file mode 100644 index 0000000..1c3c693 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-stdout.txt @@ -0,0 +1,8 @@ +-- Before Installing +-- Installing: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a.txt +-- Installing: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a/b.txt +-- Installing: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a/b/c.txt +-- Up-to-date: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a.txt +-- Up-to-date: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a/b.txt +-- Up-to-date: .*/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR-build/from/a/b/c.txt +-- After Installing diff --git a/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR.cmake b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR.cmake new file mode 100644 index 0000000..24e5282 --- /dev/null +++ b/Tests/RunCMake/file/INSTALL-FILES_FROM_DIR.cmake @@ -0,0 +1,7 @@ +set(src ${CMAKE_CURRENT_SOURCE_DIR}/from) +set(dst ${CMAKE_CURRENT_BINARY_DIR}/from) +file(REMOVE RECURSE ${dst}) +message(STATUS "Before Installing") +file(INSTALL FILES a.txt a/b.txt a/b/c.txt FILES_FROM_DIR ${src} DESTINATION ${dst}) +file(INSTALL FILES a.txt a/b.txt a/b/c.txt FILES_FROM_DIR from DESTINATION ${dst}) +message(STATUS "After Installing") diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake index 63cbdd9..26051b4 100644 --- a/Tests/RunCMake/file/RunCMakeTest.cmake +++ b/Tests/RunCMake/file/RunCMakeTest.cmake @@ -8,6 +8,8 @@ run_cmake(UPLOAD-unused-argument) run_cmake(UPLOAD-httpheader-not-set) run_cmake(UPLOAD-pass-not-set) run_cmake(INSTALL-DIRECTORY) +run_cmake(INSTALL-FILES_FROM_DIR) +run_cmake(INSTALL-FILES_FROM_DIR-bad) run_cmake(INSTALL-MESSAGE-bad) run_cmake(FileOpenFailRead) run_cmake(LOCK) diff --git a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON.cmake b/Tests/RunCMake/file/from/a.txt index e69de29..e69de29 100644 --- a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON.cmake +++ b/Tests/RunCMake/file/from/a.txt diff --git a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-OFF.cmake b/Tests/RunCMake/file/from/a/b.txt index e69de29..e69de29 100644 --- a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-OFF.cmake +++ b/Tests/RunCMake/file/from/a/b.txt diff --git a/Tests/RunCMake/file/from/a/b/c.txt b/Tests/RunCMake/file/from/a/b/c.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/file/from/a/b/c.txt diff --git a/Tests/RunCMake/project/ProjectDescription-stdout.txt b/Tests/RunCMake/project/ProjectDescription-stdout.txt new file mode 100644 index 0000000..ffa9092 --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription-stdout.txt @@ -0,0 +1 @@ +PROJECT_DESCRIPTION=Test Project diff --git a/Tests/RunCMake/project/ProjectDescription.cmake b/Tests/RunCMake/project/ProjectDescription.cmake new file mode 100644 index 0000000..3a47362 --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0048 NEW) +project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION "Test Project" LANGUAGES) +if(NOT PROJECT_DESCRIPTION) + message(FATAL_ERROR "PROJECT_DESCRIPTION expected to be set") +endif() +message(STATUS "PROJECT_DESCRIPTION=${PROJECT_DESCRIPTION}") diff --git a/Tests/RunCMake/project/ProjectDescription2-result.txt b/Tests/RunCMake/project/ProjectDescription2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/project/ProjectDescription2-stderr.txt b/Tests/RunCMake/project/ProjectDescription2-stderr.txt new file mode 100644 index 0000000..558e2df --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription2-stderr.txt @@ -0,0 +1 @@ + DESCRITPION may be specified at most once. diff --git a/Tests/RunCMake/project/ProjectDescription2.cmake b/Tests/RunCMake/project/ProjectDescription2.cmake new file mode 100644 index 0000000..3f186ba --- /dev/null +++ b/Tests/RunCMake/project/ProjectDescription2.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0048 NEW) +project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION "Test Project" DESCRIPTION "Only once allowed" LANGUAGES) diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake index dba97d2..3d13e2e 100644 --- a/Tests/RunCMake/project/RunCMakeTest.cmake +++ b/Tests/RunCMake/project/RunCMakeTest.cmake @@ -7,6 +7,8 @@ run_cmake(LanguagesImplicit) run_cmake(LanguagesEmpty) run_cmake(LanguagesNONE) run_cmake(LanguagesTwice) +run_cmake(ProjectDescription) +run_cmake(ProjectDescription2) run_cmake(VersionAndLanguagesEmpty) run_cmake(VersionEmpty) run_cmake(VersionInvalid) diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp new file mode 100644 index 0000000..cfa90cc --- /dev/null +++ b/Utilities/IWYU/mapping.imp @@ -0,0 +1,136 @@ +[ + # C++ alternatives to C standard headers + { include: [ "<assert.h>", public, "<cassert>", public ] }, + { include: [ "<complex.h>", public, "<ccomplex>", public ] }, + { include: [ "<ctype.h>", public, "<cctype>", public ] }, + { include: [ "<errno.h>", public, "<cerrno>", public ] }, + { include: [ "<float.h>", public, "<cfloat>", public ] }, + { include: [ "<iso646.h>", public, "<ciso646>", public ] }, + { include: [ "<limits.h>", public, "<climits>", public ] }, + { include: [ "<locale.h>", public, "<clocale>", public ] }, + { include: [ "<math.h>", public, "<cmath>", public ] }, + { include: [ "<setjmp.h>", public, "<csetjmp>", public ] }, + { include: [ "<signal.h>", public, "<csignal>", public ] }, + { include: [ "<stdarg.h>", public, "<cstdarg>", public ] }, + { include: [ "<stddef.h>", public, "<cstddef>", public ] }, + { include: [ "<stdio.h>", public, "<cstdio>", public ] }, + { include: [ "<stdlib.h>", public, "<cstdlib>", public ] }, + { include: [ "<string.h>", public, "<cstring>", public ] }, + { include: [ "<time.h>", public, "<ctime>", public ] }, + { include: [ "<wchar.h>", public, "<cwchar>", public ] }, + { include: [ "<wctype.h>", public, "<cwctype>", public ] }, + + # HACK: check whether this can be removed with next iwyu release. + { include: [ "<bits/time.h>", private, "<time.h>", public ] }, + { include: [ "<bits/types/clock_t.h>", private, "<time.h>", public ] }, + { include: [ "<bits/types/struct_timespec.h>", private, "<time.h>", public ] }, + { include: [ "<bits/types/struct_timeval.h>", private, "<time.h>", public ] }, + { include: [ "<bits/types/struct_tm.h>", private, "<time.h>", public ] }, + { include: [ "<bits/types/time_t.h>", private, "<time.h>", public ] }, + + # HACK: check whether this can be removed with next iwyu release. + { symbol: [ "__GLIBC__", private, "<stdlib.h>", public ] }, + { symbol: [ "_Noreturn", private, "<stdlib.h>", public ] }, + + # HACK: iwyu wrongly thinks that including <iosfwd> is sufficient. + { symbol: [ "std::stringstream", private, "<sstream>", public ] }, + { symbol: [ "std::istringstream", private, "<sstream>", public ] }, + { symbol: [ "std::ostringstream", private, "<sstream>", public ] }, + + # HACK: iwyu suggests those two files each time vector[] is used. + # https://github.com/include-what-you-use/include-what-you-use/issues/166 + { include: [ "<ext/alloc_traits.h>", private, "<vector>", public ] }, + { include: [ "<memory>", public, "<vector>", public ] }, + + # TODO: enable this block and remove some <utility> includes? + #{ symbol: [ "std::pair", private, "<utility>", public ] }, + #{ symbol: [ "std::pair", private, "<map>", public ] }, + #{ symbol: [ "std::pair", private, "<set>", public ] }, + + # Wrappers for headers added in TR1 / C++11 + # { include: [ "<array>", public, "\"cm_array.hxx\"", public ] }, + # { include: [ "<functional>", public, "\"cm_functional.hxx\"", public ] }, + # { include: [ "<memory>", public, "\"cm_memory.hxx\"", public ] }, + { include: [ "<unordered_map>", public, "\"cm_unordered_map.hxx\"", public ] }, + { include: [ "<unordered_set>", public, "\"cm_unordered_set.hxx\"", public ] }, + # { include: [ "<tr1/array>", public, "\"cm_array.hxx\"", public ] }, + # { include: [ "<tr1/functional>", public, "\"cm_functional.hxx\"", public ] }, + # { include: [ "<tr1/memory>", public, "\"cm_memory.hxx\"", public ] }, + { include: [ "<tr1/unordered_map>", public, "\"cm_unordered_map.hxx\"", public ] }, + { include: [ "<tr1/unordered_set>", public, "\"cm_unordered_set.hxx\"", public ] }, + + # KWIML + { include: [ "<stdint.h>", public, "\"cm_kwiml.h\"", public ] }, + { include: [ "<inttypes.h>", public, "\"cm_kwiml.h\"", public ] }, + + # Self-sufficient wrapper for <sys/stat.h> + { include: [ "<sys/stat.h>", public, "\"cm_sys_stat.h\"", public ] }, + { symbol: [ "mode_t", private, "\"cm_sys_stat.h\"", public ] }, + + # TODO: remove once TR1 / C++11 is required. + { include: [ "\"cmsys/hash_fun.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] }, + { include: [ "\"cmsys/hash_fun.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] }, + { include: [ "\"cmsys/hash_map.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] }, + { include: [ "\"cmsys/hash_set.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] }, + { include: [ "\"cmsys/hashtable.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] }, + { include: [ "\"cmsys/hashtable.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] }, + + # Wrappers for 3rd-party libraries used from the system. + { include: [ "<archive.h>", private, "\"cm_libarchive.h\"", public ] }, + { include: [ "<archive_entry.h>", private, "\"cm_libarchive.h\"", public ] }, + { include: [ "@<curl/.+\\.h>", private, "\"cm_curl.h\"", public ] }, + { include: [ "<expat.h>", private, "\"cm_expat.h\"", public ] }, + { include: [ "<expat_external.h>", private, "\"cm_expat.h\"", public ] }, + { include: [ "<json/reader.h>", private, "\"cm_jsoncpp_reader.h\"", public ] }, + { include: [ "<json/value.h>", private, "\"cm_jsoncpp_value.h\"", public ] }, + { include: [ "<json/writer.h>", private, "\"cm_jsoncpp_writer.h\"", public ] }, + { include: [ "<rhash.h>", private, "\"cm_rhash.h\"", public ] }, + { include: [ "<uv.h>", private, "\"cm_uv.h\"", public ] }, + { include: [ "@<uv-.+\\.h>", private, "\"cm_uv.h\"", public ] }, + { include: [ "<kwiml/abi.h>", private, "\"cm_kwiml.h\"", public ] }, + { include: [ "<kwiml/int.h>", private, "\"cm_kwiml.h\"", public ] }, + { include: [ "<xmlrpc.h>", private, "\"cm_xmlrpc.h\"", public ] }, + { include: [ "<xmlrpc_client.h>", private, "\"cm_xmlrpc.h\"", public ] }, + { include: [ "@<xmlrpc-c/.+\\.h>", private, "\"cm_xmlrpc.h\"", public ] }, + { include: [ "<zconf.h>", private, "\"cm_zlib.h\"", public ] }, + { include: [ "<zlib.h>", private, "\"cm_zlib.h\"", public ] }, + + # Wrappers for bundled 3rd-party libraries. + { include: [ "\"cmlibarchive/libarchive/archive.h\"", private, "\"cm_libarchive.h\"", public ] }, + { include: [ "\"cmlibarchive/libarchive/archive_entry.h\"", private, "\"cm_libarchive.h\"", public ] }, + { include: [ "@\"cmcurl/include/curl/.+\\.h\"", private, "\"cm_curl.h\"", public ] }, + { include: [ "\"cmexpat/lib/expat.h\"", private, "\"cm_expat.h\"", public ] }, + { include: [ "\"cmexpat/lib/expat_external.h\"", private, "\"cm_expat.h\"", public ] }, + { include: [ "\"cmjsoncpp/include/json/reader.h\"", private, "\"cm_jsoncpp_reader.h\"", public ] }, + { include: [ "\"cmjsoncpp/include/json/value.h\"", private, "\"cm_jsoncpp_value.h\"", public ] }, + { include: [ "\"cmjsoncpp/include/json/writer.h\"", private, "\"cm_jsoncpp_writer.h\"", public ] }, + { include: [ "\"cmlibrhash/librhash/rhash.h\"", private, "\"cm_rhash.h\"", public ] }, + { include: [ "\"cmlibuv/include/uv.h\"", private, "\"cm_uv.h\"", public ] }, + { include: [ "@\"cmlibuv/include/uv-.+\\.h\"", private, "\"cm_uv.h\"", public ] }, + { include: [ "\"KWIML/include/kwiml/abi.h\"", private, "\"cm_kwiml.h\"", public ] }, + { include: [ "\"KWIML/include/kwiml/int.h\"", private, "\"cm_kwiml.h\"", public ] }, + { include: [ "\"cmzlib/cm_zlib_mangle.h\"", private, "\"cm_zlib.h\"", public ] }, + { include: [ "\"cmzlib/zconf.h\"", private, "\"cm_zlib.h\"", public ] }, + { include: [ "\"cmzlib/zlib.h\"", private, "\"cm_zlib.h\"", public ] }, + + { symbol: [ "std::ifstream", private, "\"cmsys/FStream.hxx\"", public ] }, + { symbol: [ "std::ofstream", private, "\"cmsys/FStream.hxx\"", public ] }, + { symbol: [ "cmsys::ifstream", private, "\"cmsys/FStream.hxx\"", public ] }, + { symbol: [ "cmsys::ofstream", private, "\"cmsys/FStream.hxx\"", public ] }, + + { include: [ "<istream>", public, "\"cmsys/FStream.hxx\"", public ] }, + { include: [ "<ostream>", public, "\"cmsys/FStream.hxx\"", public ] }, + { include: [ "<fstream>", public, "\"cmsys/FStream.hxx\"", public ] }, + + # major and minor are used as macro arguments. Those are false matches. + { symbol: [ "major", private, "\"cm_kwiml.h\"", public ] }, + { symbol: [ "minor", private, "\"cm_kwiml.h\"", public ] }, + { symbol: [ "major", private, "\"cmVersion.h\"", public ] }, + { symbol: [ "minor", private, "\"cmVersion.h\"", public ] }, + + { include: [ "<curses.h>", private, "\"cmCursesStandardIncludes.h\"", public ] }, + { include: [ "\"form.h\"", private, "\"cmCursesStandardIncludes.h\"", public ] }, + { include: [ "<form.h>", private, "\"cmCursesStandardIncludes.h\"", public ] }, +] + +# vim: set ft=toml: diff --git a/Utilities/KWIML/test/CMakeLists.txt b/Utilities/KWIML/test/CMakeLists.txt index 1bf93bb..40fe62f 100644 --- a/Utilities/KWIML/test/CMakeLists.txt +++ b/Utilities/KWIML/test/CMakeLists.txt @@ -38,6 +38,8 @@ endif() add_executable(kwiml_test ${test_srcs}) set_property(TARGET kwiml_test PROPERTY COMPILE_DEFINITIONS ${test_defs}) +set_property(TARGET kwiml_test PROPERTY C_INCLUDE_WHAT_YOU_USE "") +set_property(TARGET kwiml_test PROPERTY CXX_INCLUDE_WHAT_YOU_USE "") set_property(TARGET kwiml_test PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_test(NAME ${KWIML_TEST_PREFIX}.test COMMAND kwiml_test) |