summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'fileapi-install-generators'Brad King2019-08-051-1/+3
|\ | | | | | | | | | | | | d70a0f8681 fileapi: Fix codemodel target install destination for cross-dir rules Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3639
| * fileapi: Fix codemodel target install destination for cross-dir rulesBrad King2019-07-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Since commit e89ad0f94e (install: Allow installing targets created in another directory, 2018-06-18, v3.13.0-rc1~407^2) we support calling `install(TARGETS)` for targets created in another directory. However, install generators are associated with the directory in which the call to `install()` appears. This may not be the same directory in which the target is defined. Record in each target the list of install generators it has. Fixes: #19546
* | cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-1/+1
| | | | | | | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* | AIX: Create import library for executables with exportsBrad King2019-07-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On AIX, plugins meant to be loaded into executables via `dlopen` must be linked with access to a list of symbols exported from the executable in order to use them (when not using runtime linking). The AIX linker supports specifying this list as an "import file" passed on the command line either via the `-bI:...` option or (with a leading `#! .` line) as a normal input file like any other library file. The linker import file plays the same role on AIX as import libraries do on Windows. Teach CMake to enable its import library abstraction on AIX for executables with the `ENABLE_EXPORTS` target property set. Teach our internal `ExportImportList` script to optionally generate a leading `#! .` line at the top of the generated export/import list. Update our rule for linking an executable with exports to generate a public-facing "import library" implemented as an AIX linker import file. With this approach, our existing infrastructure for handling import libraries on Windows will now work for AIX linker import files too: * Plugins that link to their executable's symbols will be automatically linked using the import file on the command line. * The executable's import file will be (optionally) installed and exported for use in linking externally-built plugins. This will allow executables and their plugins to build even if we later turn off runtime linking. Issue: #19163
* | De-duplicate checks for whether a platform uses Windows DLLsBrad King2019-07-121-6/+2
|/
* Merge topic 'iface-headers'Brad King2019-04-121-2/+1
|\ | | | | | | | | | | | | a40f9083dd INTERFACE Target: allow (PUBLIC/PRIVATE)_HEADER properties Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3181
| * INTERFACE Target: allow (PUBLIC/PRIVATE)_HEADER propertiesAvraham Shukron2019-04-111-2/+1
| | | | | | | | | | | | | | Also support installing headers on an INTERFACE library. Signed-off-by: Avraham Shukron <avraham.shukron@gmail.com> Fixes: #15234
* | cmInstallCommand: Port to cmArgumentParserRegina Pfeifer2019-04-041-82/+90
|/
* install: Do not crash on imported global targetBrad King2019-03-071-1/+5
| | | | | | | | | | | Since commit e89ad0f94e (install: Allow installing targets created in another directory, 2018-06-18, v3.13.0-rc1~407^2) the `install(TARGETS)` command may find a global-scoped target outside the calling directory. Ignore an `IMPORTED GLOBAL` target if it is found in this way. Imported targets cannot be installed, and trying to do so violates internal invariants. Fixes: #19022
* cmSystemTools::Message: Add overload accepting std::stringVitaly Stakhovsky2019-01-281-1/+1
|
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-6/+6
| | | | Reduce the number of files relying on `cmake.h`.
* install: Add sane set of defaults for DESTINATION and file type parametersKyle Edwards2018-11-071-79/+297
| | | | | | | | | | | | If the user does not specify a DESTINATION for a target type, the install() command checks to see if the appropriate variable from GNUInstallDirs is set. If it is not, then it uses an appropriate hard-coded guess. In addition, for FILES and DIRECTORY, the user can specify a file type instead of a DESTINATION, and the command will use the appropriate variable from GNUInstallDirs, or a hard-coded guess if it is not set.
* install: Record TARGET mode backtraces internallyBrad King2018-10-181-27/+31
|
* cmMakefile: Make GetSafeDefinition return std::string const&Vitaly Stakhovsky2018-09-181-3/+1
|
* cmGlobalGenerator::AddInstallComponent(): Accept std::string argumentVitaly Stakhovsky2018-08-301-13/+13
|
* install: Allow installing targets created in another directoryZack Galbreath2018-06-181-3/+7
| | | | | | | | Previously, `install(TARGETS)` would only accept targets created in the same directory scope. Relax this restriction by searching the global scope when determining whether or not a target exists. Fixes: #14444
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-5/+7
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * 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.
* install: add NAMELINK_COMPONENT argumentKyle Edwards2018-05-031-7/+39
| | | | | | | For shared libraries, this allows you to specify separate components for the shared library and for the namelink. Suggested in https://cmake.org/pipermail/cmake-developers/2014-December/024032.html.
* Identify DLL platforms via CMAKE_IMPORT_LIBRARY_SUFFIXStephan Szabo2018-03-091-2/+3
| | | | | | | Use `CMAKE_IMPORT_LIBRARY_SUFFIX` to identify platforms that have DLL import libraries rather than memorizing a list of platform names. Fixes: #16801
* install,export: Maybe transform OBJECT libraries to INTERFACE librariesBrad King2018-02-281-17/+14
| | | | | | | | | | | Teach the `install` and `export` commands to support installing and exporting `OBJECT` libraries without their object files. Transform them to `INTERFACE` libraries in such cases. For `install(TARGETS)`, activate this when no destination for the object files is specified. For `export`, activate this only under Xcode with multiple architectures when we have no well-defined object file locations to give to clients.
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-4/+4
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-3/+4
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-34/+25
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-28/+27
|
* Provide and use CM_FALLTHROUGHDaniel Pfeifer2017-06-031-2/+2
|
* Access string npos without instancePavel Solodovnikov2017-06-011-5/+5
|
* Add const-reference qualificationsPavel Solodovnikov2017-05-261-9/+11
|
* Allow OBJECT libraries to be installed, exported, and importedRobert Maynard2017-04-181-9/+41
| | | | | | | | Teach install() and export() to handle the actual object files. Disallow this on Xcode with multiple architectures because it still cannot be cleanly supported there. Co-Author: Brad King <brad.king@kitware.com>
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Apple: Add support for static frameworksGregor Jasny2017-01-311-10/+32
| | | | Closes: #16432
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-1/+0
|
* Remove redundant c_str() callsDaniel Pfeifer2016-10-301-1/+1
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-1/+16
|
* Separate compilation for commands included in cmBootstrapCommands2Daniel Pfeifer2016-10-211-0/+2
|
* cmState: Move TargetType enum to separate namespaceStephen Kelly2016-10-191-13/+13
|
* 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.
* Use CM_NULLPTRDaniel Pfeifer2016-09-161-1/+1
|
* Avoid else after returnDaniel Pfeifer2016-09-161-8/+16
|
* Add support for creating prebuilt Android.mk filesBill Hoffman2016-09-131-1/+97
| | | | | | | | | | | Add options to the `install()` and `export()` commands to export the targets we build into Android.mk files that reference them as prebuilt libraries with associated usage requirements (compile definitions, include directories, link libraries). This will allow CMake-built projects to be imported into projects using the Android NDK build system. Closes: #15562
* install: Fix evaluation of leading generator expressions in DIRECTORYYves Frederix2016-08-311-1/+2
| | | | | | | Since commit v3.5.0-rc1~58^2 (install: Allow generator expressions in DIRECTORY, 2016-01-12) we accidentally treat leading generator expressions as relative paths even though they may evaluate to absolute paths. Defer the conversion to an absolute path until after evaluation.
* use CM_NULLPTRDaniel Pfeifer2016-06-281-24/+26
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-705/+475
| | | | | | | | | | | | | 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-6/+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.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge topic 'fix-target-alias-in-subdir'Brad King2016-04-051-1/+1
|\ | | | | | | | | | | 0e44f489 Rename local target lookup methods to clarify purpose bc30f8b5 Fix lookup of an ALIAS target outside aliased target's directory (#16044)
| * Rename local target lookup methods to clarify purposeBrad King2016-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | Rename methods: * `cmMakefile::Find{ => LocalNonAlias}Target` * `cmLocalGenerator::Find{ => LocalNonAlias}GeneratorTarget` These names clarify that they are for directory-local target names and do not consider alias targets.
* | Merge topic 'install-EXCLUDE_FROM_ALL'Brad King2016-02-091-4/+27
|\ \ | |/ |/| | | | | | | | | 586e56d0 Help: Add notes for topic 'install-EXCLUDE_FROM_ALL' d321c196 Tests: Add cases for install() command EXCLUDE_FROM_ALL option 18ce97c4 install: Add EXCLUDE_FROM_ALL option (#14921)
| * install: Add EXCLUDE_FROM_ALL option (#14921)Nick Lewis2016-02-041-4/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let us take an example of a project that has some tests in a component that need to be installed into a dedicated test package. The user expectation is that the result could be achieved by typing the following: make make tests make install DESTDIR=/testpkgs make install-tests However this results in test components in the default installation as well as the testpkg. Add an EXCLUDE_FROM_ALL option to the install() command to tell it that the installation rule should not be included unless its component is explicitly specified for installation.
* | install(EXPORT): Fix crash on target in another directoryBrad King2016-02-051-3/+5
|/ | | | | | | | | | | | | | | | Refactoring merged by commit v3.5.0-rc1~299 (Merge topic 'use-generator-target', 2015-10-20) in and around commit v3.5.0-rc1~299^2~13 (cmExportSet: Store a cmGeneratorTarget, 2015-10-17) changed export sets to delay looking up actual targets and stores only their names. However, in InstallCommand::HandleExportMode we need to lookup targets immediately to check them for EXPORT_LINK_INTERFACE_LIBRARIES. The check was accidentally made local to the current directory, so if an export set contains a target from another directory the lookup fails and CMake crashes. Fix the check to look up the target name globally, and tolerate when no target is found just in case. Reported-by: Kelly Thompson <kgt@lanl.gov>
* Merge topic 'fix-install-rules'Brad King2015-11-101-6/+1
|\ | | | | | | | | 9103d8ac Install: Move SetHaveInstallRule to a more-obvious place