summaryrefslogtreecommitdiffstats
path: root/Source/cmExportInstallFileGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Export: Factor out file generation steps into helpersBill Hoffman2016-09-081-69/+84
| | | | | Do not actually generate any content in the driving code paths. Use helpers for that.
* install: Fix computed import prefix in export files when it is "/"Ben Keller2016-09-061-1/+4
| | | | | | | | | | | | | | | | | | When exporting from a project (with install(EXPORT ...)), the `<PROJECT>Targets.cmake` file contains logic for computing the `_IMPORT_PREFIX` from its own location. This `_IMPORT_PREFIX` is then used in the `<PROJECT>Targets-<config>.cmake` file to generate the `IMPORTED_LOCATION_<CONFIG>`. The generation unconditionally appends a "/" to `_IMPORT_PREFIX` before appending the rest of the path. If `_IMPORT_PREFIX` is "/", then the `IMPORTED_LOCATION_<CONFIG>` properties all start with exactly two leading slashes ("//"). Exactly two leading slashes is a special case in POSIX file paths, such that its interpretation is left up to the implementation. This means that changing the path prefix from "/" to "//" should not be allowed. Since references to `_IMPORT_PREFIX` are always followed by a "/", simply check the value to replace "/" with "".
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-0/+10
|
* Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-1/+1
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-234/+158
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Isolate formatted streaming blocks with clang-format off/onBrad King2016-05-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clang-format tool can do a good job formatting most code, but well-organized streaming blocks are best left manually formatted. Find blocks of the form os << "...\n" "...\n" ; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}' Find blocks of the form os << "...\n" << "...\n" << "...\n"; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}' Surround such blocks with the pair /* clang-format off */ ... /* clang-format on */ in order to protect them from update by clang-format. Use the C-style `/*...*/` comments instead of C++-style `//...` comments in order to prevent them from ever being swallowed by re-formatting of surrounding comments.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* cmExportInstallFileGenerator: Fix crash in FindNamespacesAndrey Pokrovskiy2016-01-211-1/+1
| | | | | | | | | | | | | | | | | | Refactoring merged by commit 9afbb733ec (Merge topic 'use-generator-target', 2015-10-20) in and around commit 381e7afd (cmExportSet: Store a cmGeneratorTarget, 2015-10-17) forgot to update one place in this method. This leads to a crash in code such as add_library(A a.c) add_library(B b.c) target_link_libraries(B A) install(TARGETS B DESTINATION lib EXPORT ExpB) install(EXPORT ExpB DESTINATION lib/cmake/test) add_executable(C c.c) install(TARGETS C DESTINATION bin EXPORT ExpC) Fix the target name reference to avoid using an unpopulated Target pointer.
* Access policy status from cmGeneratorTarget at generate time.Stephen Kelly2015-10-201-2/+2
|
* cmGeneratorTarget: Copy IsAppBundleOnApple from cmTarget.Stephen Kelly2015-10-191-1/+1
| | | | Leave the cmTarget method behind for now to implement cmInstallCommand.
* cmGeneratorTarget: Move GetExportName from cmTarget.Stephen Kelly2015-10-181-2/+2
|
* Export: Port internal API to cmGeneratorTarget.Stephen Kelly2015-10-181-2/+2
|
* Export: Port internal utility to cmGeneratorTarget.Stephen Kelly2015-10-181-7/+7
|
* Export: Port some API to cmGlobalGenerator.Stephen Kelly2015-10-181-4/+4
|
* cmInstallTargetGenerator: Port GetInstallFilename to cmGeneratorTarget.Stephen Kelly2015-10-181-2/+2
|
* Export: Port interface to cmGeneratorTarget.Stephen Kelly2015-10-181-16/+15
|
* cmExportSet: Store a cmGeneratorTarget.Stephen Kelly2015-10-181-12/+10
| | | | Set the member at compute time from the stored name.
* cmState: Move TargetType enum from cmTarget.Stephen Kelly2015-10-141-3/+3
| | | | | | | Mostly automated: values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType") for i in "${values[@]}"; do git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done
* cmInstallExportGenerator: Require cmLocalGenerator, not cmMakefile.Stephen Kelly2015-08-231-2/+2
|
* cmGeneratorTarget: Move GetInstallNameDir* from cmTarget.Stephen Kelly2015-08-051-2/+2
|
* Export: Port more API to cmGeneratorTarget.Stephen Kelly2015-08-051-1/+5
|
* cmExportInstallFileGenerator: Simplify local generator access.Stephen Kelly2015-08-041-1/+1
|
* cmInstallTargetGenerator: Port to cmGeneratorTarget.Stephen Kelly2015-07-301-1/+1
|
* Port some of the cmExportFileGenerator API to cmGeneratorTarget.Stephen Kelly2015-07-271-2/+4
| | | | | Enough to make it more possible to move GetLinkInterface to cmGeneratorTarget.
* Port to cmMakefile::GetGlobalGenerator.Stephen Kelly2015-05-031-1/+1
|
* Include cmAlgorithms where it is used.Stephen Kelly2015-03-101-0/+1
|
* install: Allow generator expressions in TARGETS DESTINATION (#14317)Brad King2015-02-111-1/+1
| | | | | | | | | | | | This will allow per-config destinations for targets in EXPORT sets. Using multiple install(TARGETS) with separate CONFIGURATIONS is rejected as a target appearing more than once in an export set. Now instead one can write install(TARGETS foo EXPORT exp DESTINATION lib/$<CONFIG>) to get a single logical membership of the target in the export set while still having a per-config destination.
* cmInstallGenerator: Move GetDestination to subclasses that need itBrad King2015-02-111-4/+4
| | | | | | The method is used only for EXPORT and TARGET install destinations. While at it, make it return a std::string by reference instead of a "const char*".
* Allow export of targets with INTERFACE_SOURCES.Stephen Kelly2015-02-101-12/+16
| | | | | | Use the same rules for paths in source and binary dirs in installed INTERFACE_SOURCES as are used for INTERFACE_INCLUDE_DIRECTORIES.
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-4/+4
| | | | All compilers hosting CMake support the std class.
* install: Allow absolute EXPORT destination with relative targets (#15258)Brad King2014-12-151-37/+20
| | | | | | | | | | | | | | | | | When install(EXPORT) is given an absolute destination we cannot compute the install prefix relative to the installed export file location. Previously we disallowed installation of targets in such exports with a relative destination, but did not enforce this for target property values besides the location of the main target file. This could lead to broken installations when the EXPORT is installed to an absolute path but usage requirements are specified relative to the install prefix. Since an EXPORT installed to an absolute destination cannot be relocated we can just hard-code the value of CMAKE_INSTALL_PREFIX as the base for relative paths. This will allow absolute install(EXPORT) destinations to work with relative destinations for targets and usage requirements. Extend the ExportImport test with a case covering this behavior.
* Export: Disallow export of targets with INTERFACE_SOURCESStephen Kelly2014-11-291-0/+11
| | | | | | | | | | | | | | | | | | | This can be allowed in the next release, but it needs to have some features present and tested such as * Ensuring that relative paths do not appear in the generated property. * Ensuring that paths to the source or build directories do not appear. * Generating a check in the file for CMake 3.1 or later so that the resulting property will be consumed. * Ensuring that any referenced targets are part of an export set and generating a check for them. * INSTALL_INTERFACE and BUILD_INTERFACE content. All of these checks are already done for INTERFACE_INCLUDE_DIRECTORIES, but it is too late to add them for INTERFACE_SOURCES for CMake 3.1. As the checks introduce some new error conditions, it is better to disallow exporting fully for this case and introduce proper error conditions later instead of policies.
* Export: Populate INTERFACE_COMPILE_FEATURES property.Stephen Kelly2014-04-081-0/+4
|
* Remove c_str calls when using stream APIs.Stephen Kelly2014-03-111-1/+1
| | | | | Use an ad-hoc clang tool for matching the calls which should be ported.
* Remove some c_str() calls.Stephen Kelly2014-03-111-1/+1
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* stringapi: Pass configuration names as stringsBen Boeckel2014-03-081-4/+7
|
* CMake 3.0.0-rc1 version updateBrad King2014-02-191-1/+1
|
* Export: Use the CMAKE_DEVEL_VERSION macro for build-export files.Stephen Kelly2014-02-111-14/+0
| | | | | Move the macro definition to the cmExportBuildFileGenerator.h header to share it.
* Export: Fix internal CMake version test logicBrad King2014-02-101-4/+6
| | | | | | | | | Fix the internal DEVEL_CMAKE_VERSION macro to use CMake_VERSION_ENCODE to compare version component-wise. Otherwise an old invocation of the macro may be tricked into using the current version when the requested major version is smaller than the current version but the requested minor version is larger. It should use the requested (old) version in that case.
* Export: Use a macro to ensure minimum development version requirementStephen Kelly2014-02-091-1/+13
| | | | | Use the version number of the specified release, or of the current development version if the release is not yet made.
* export: Only generate and install configuration files if needed.Stephen Kelly2014-01-041-6/+15
| | | | | | | | | | The modern way to create configuration dependent content is using generator expressions in the main export file. The only non-deprecated property still generated in the configuration-specific files are IMPORTED_LOCATION_<CONFIG> INTERFACE_LIBRARY targets have no location, and no need for those files.
* install: Rename variable referencing cmake version.Stephen Kelly2014-01-041-3/+3
| | | | | | | | The next version is 3.0.0, not 2.8.13. The version generated in the export file should be updated in the release branch in both cmExportInstallFileGenerator and cmExportBuildFileGenerator.
* Export: Skip INTERFACE libraries when generating -config files.Stephen Kelly2013-12-191-7/+5
| | | | | | | | The properties object has just been created, so is always empty, which means the if block is never entered. The following lines do not have any effect because an INTERFACE library has no LOCATION. At the end, no code is generated for INTERFACE libraries in config-specific exported files, so skip them early.
* QtAutoUic: Add INTERFACE_AUTOUIC_OPTIONS target property.Stephen Kelly2013-11-271-0/+4
| | | | | | | | | | | | | | | | | | | | Transitively consume the property from linked dependents. Implement configuration-specific support by following the pattern set out for compile definitions and includes in cmQtAutoGenerators. Implement support for origin-tracking with CMAKE_DEBUG_TARGET_PROPERTIES. This is motivated by the needs of KDE, which provides a separate translation system based on gettext instead of the Qt linguist translation system. The Qt uic tool provides command line options for configuring the method used to translate text, and to add an include directive to the generated file to provide the method. http://thread.gmane.org/gmane.comp.kde.devel.frameworks/7930/focus=7992 Implement the interface to provide the uic options as a usage-requirement on the KI18n target, as designed for KDE.
* Use new cmHasLiteralPrefix functionStephen Kelly2013-11-211-4/+4
|
* cmExportInstallFileGenerator: Fix comment to match reality.Stephen Kelly2013-10-101-2/+2
| | | | It was copied from cmExportBuildFileGenerator.
* install: Teach EXPORT option to handle INTERFACE_LIBRARY targetsStephen Kelly2013-10-081-1/+18
|
* CMake 2.8.12-rc1Brad King2013-08-151-1/+1
|