summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'vs-global-props-for-all-targets'Brad King2018-09-281-0/+25
|\ | | | | | | | | | | | | | | 36489b85aa VS: Add test for CMAKE_VS_GLOBALS 22e670a306 VS: Add option to set VS_GLOBAL_* for all targets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2345
| * VS: Add option to set VS_GLOBAL_* for all targetsMikhail Korolev2018-09-251-0/+25
| | | | | | | | Fixes: #18287
* | LINK_DIRECTORIES: Add new properties and commandsMarc Chevrier2018-09-251-13/+66
| | | | | | | | | | | | | | | | | | | | | | | | These new capabilities enable to manage link directories Two new properties: * target properties: LINK_DIRECTORIES and INTERFACE_LINK_DIRECTORIES One new command * target_link_directories(): to populate target properties Fixes: #17215
* | Refactoring: introduce function to check if a string is a generator expressionMarc Chevrier2018-09-251-3/+1
|/
* Merge topic 'getsafedef-stdstring'Brad King2018-09-181-4/+2
|\ | | | | | | | | | | | | f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const& Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2350
| * cmMakefile: Make GetSafeDefinition return std::string const&Vitaly Stakhovsky2018-09-181-4/+2
| |
* | target_link_libraries: Allow use with targets in other directoriesBrad King2018-09-121-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the command did not allow naming targets on the LHS that were not created in the calling directory. Lift this restriction to enable more flexible use by projects. Targets named on the RHS will need to be looked up during generation in the scope of the call site rather than the scope of the LHS target. Introduce an internal syntax in `[INTERFACE_]LINK_LIBRARIES` properties to specify target names that need to be looked up in a directory other than that containing the target on which the property is set. Add minimal documentation of the syntax to help users that encounter it. Unfortunately CMake previously did allow such calls in the case that only `INTERFACE` libraries are specified, but those libraries would be looked up in the target's directory rather than the caller's. Add policy `CMP0079` to enable the new behavior with new lookup scope in a compatible way. Fixes: #17943
* | cmTarget: Future-proof AddLinkLibrary target lookup scopeBrad King2018-09-121-1/+1
|/ | | | | | | | | The `AddLinkLibrary` method takes a `cmMakefile` pointer to represent the scope of the caller that wants to link to the named library. Currently in all call sites this is the same as the target's `Makefile` member, but in principle the library named by the caller is visible in its scope so we should use the `cmMakefile` it provided to look up the library target.
* cmMakefile: return directories as const std::string&Vitaly Stakhovsky2018-08-271-4/+5
|
* cmStateDirectory: use const std::string& for return valuesVitaly Stakhovsky2018-08-121-2/+4
|
* Xcode: Add variables and properties to configure schemesGregor Jasny2018-08-011-0/+25
| | | | | | | | | Add `XCODE_SCHEME_*` target properties and associated variables `CMAKE_XCODE_SCHEME_*` to initialize them on target creation. Map each target property value to an associated Xcode scheme entry. Co-Author: Martin Sander <mail@martin-sander.de> Fixes: #17919
* Add GetSafeProperty method to cmTarget, cmGeneratorTarget and cmSourceFileSebastian Holtermann2018-07-021-0/+9
|
* LINK_OPTIONS: Add new family of propertiesMarc Chevrier2018-06-061-6/+71
| | | | | | | | | | | | | | This family enable to manage link flags Three new properties: * directory property: LINK_OPTIONS * target properties: LINK_OPTIONS and INTERFACE_LINK_OPTIONS Two new commands * add_link_options(): to populate directory property * target_link_options(): to populate target properties Fixes: #16543
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-8/+11
| | | | | | | | | | | | 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.
* added CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION variableMichael Stürmer2018-05-151-0/+4
| | | | Fixes: #17955
* Merge topic 'variable-CMAKE_FOLDER'Brad King2018-04-021-0/+1
|\ | | | | | | | | | | | | df535ad846 Add CMAKE_FOLDER variable to initialize FOLDER target property Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1896
| * Add CMAKE_FOLDER variable to initialize FOLDER target propertyMarc B2018-03-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be used for example to organize all following targets into one Visual Studio folder: set(CMAKE_FOLDER Libraries) add_subdirectory(libA) add_subdirectory(libB) set(CMAKE_FOLDER Executables) add_subdirectory(progA) Another possibility is using the current directory name for all following targets in subdirectories: get_filename_component(dirname "${CMAKE_CURRENT_SOURCE_DIR}" NAME) string(APPEND CMAKE_FOLDER "/${dirname}")
* | cmTarget: Remove unused variableBrad King2018-03-281-6/+1
|/ | | | | | Remove an unused variable and its containing local scope accidentally left by commit v3.11.0-rc1~44^2 (Reduce allocation of temporary values on heap, 2018-01-25).
* Merge topic 'update-dllplatform'Brad King2018-03-121-2/+2
|\ | | | | | | | | | | | | 2dc2a3eb15 Identify DLL platforms via CMAKE_IMPORT_LIBRARY_SUFFIX Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1832
| * Identify DLL platforms via CMAKE_IMPORT_LIBRARY_SUFFIXStephan Szabo2018-03-091-2/+2
| | | | | | | | | | | | | | Use `CMAKE_IMPORT_LIBRARY_SUFFIX` to identify platforms that have DLL import libraries rather than memorizing a list of platform names. Fixes: #16801
* | Do not produce legacy _LIB_DEPENDS cache entriesBrad King2018-03-071-1/+3
| | | | | | | | | | | | Introduce policy `CMP0073` to avoid producing these cache entries. Fixes: #16364
* | cmTarget: Remove unnecessary RecordDependencies memberBrad King2018-03-061-10/+3
| | | | | | | | Inline the condition in the one remaining place it is checked.
* | cmTarget: Simplify ClearDependencyInformation implementationBrad King2018-03-061-16/+1
| | | | | | | | | | | | | | | | | | Remove the `<target>_LIB_DEPENDS` cache entry unconditionally. It will be populated again later if needed. There is no need to ask the user to remove the cache entry if the target type changes. Issue: #16364
* | cmTarget: Simplify ClearDependencyInformation signatureBrad King2018-03-061-4/+3
|/ | | | We don't need to pass an argument with the target's own name.
* objlib: Allow other libraries to link to `OBJECT` libraries.Deniz Bahadir2018-03-011-10/+8
| | | | | | | | Note: This only allows `OBJECT` libraries to be on the right-hand side of `target_link_libraries` but still does not link its object-files to the target on the left-hand side. Issue: #14778
* MAINT: Misc. typosluz.paz2018-02-131-1/+1
| | | | Found via `codespell -q 3 -I ../cmake-whitelist.txt`.
* cmTarget: use static strings for special property namesBen Boeckel2018-01-311-14/+28
| | | | | Similar to 660769151a7f628f92eb28d77bcae854eaae54c2, the `SetProperty` side is showing up in performance listings due to string comparisons.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-5/+7
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Autogen: Process files concurrently in AUTOMOC and AUTOUICSebastian Holtermann2018-01-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | This introduces concurrent thread processing in the `_autogen` target wich processes AUTOMOC and AUTOUIC. Source file parsing is distributed among the threads by using a job queue from which the threads pull new parse jobs. Each thread might start an independent ``moc`` or ``uic`` process. Altogether this roughly speeds up the AUTOMOC and AUTOUIC build process by the number of physical CPUs on the host system. The exact number of threads to start in the `_autogen` target is controlled by the new AUTOGEN_PARALLEL target property which is initialized by the new CMAKE_AUTOGEN_PARALLEL variable. If AUTOGEN_PARALLEL is empty or unset (which is the default) the thread count is set to the number of physical CPUs on the host system. The AUTOMOC/AUTOUIC generator and the AUTORCC generator are refactored to use a libuv loop internally. Closes #17422.
* cmSourceFile: mark known locations as suchBen Boeckel2018-01-101-2/+4
| | | | | | | | | | Primarily, this includes: - the rule files generated for custom targets; - source files representing custom targets directly; - outputs of custom commands; - byproducts of custom commands; and - dependencies of custom commands.
* cmSourceFileLocation: allow skipping ambiguous extensionsBen Boeckel2018-01-101-0/+1
| | | | | | | | | | | The ambiguous extension logic is an old behavior that ends up taking lots of extra compute cycles to execute. This is triggered by various CMake codepaths which pass extension-less paths down when CMake actually knows that they are not ambiguous. These codepaths will be indicated in upcoming changes. Various APIs have gained a cmSourceFileLocationKind parameter, but they are all optional and default to the existing behavior.
* Merge topic 'fortran-compiler-launcher'Brad King2017-11-291-0/+1
|\ | | | | | | | | | | | | f19c70c3 Fortran: Add option to run the compiler through launcher tools Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1517
| * Fortran: Add option to run the compiler through launcher toolsBrad King2017-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | Add a `Fortran_COMPILER_LAUNCHER` target property like those added for C and CXX by commit v3.4.0-rc1~450^2 (Add options to launch the compiler through tools like ccache or distcc, 2015-06-04) and CUDA by commit v3.10.0-rc1~531^2 (CUDA: Add option to run the compiler through launcher tools, 2017-06-09). Fixes: #17499
* | server: return whether or not a target is generator providedJustin Goshi2017-11-201-0/+1
|/ | | | | | Some generators auto-generate targets. For example VS generators create the ALL_BUILD target. Add the ability to mark targets as generator provided and return that info through cmake-server codemodel.
* CUDA: Add CMAKE_CUDA_SEPARABLE_COMPILATION variableBrad King2017-11-171-0/+1
| | | | | | | Use its value to initialize the `CUDA_SEPARABLE_COMPILATION` target property when targets are created. Fixes: #17478
* Add new target-property `IMPORTED_GLOBAL`.Deniz Bahadir2017-11-071-0/+53
| | | | | | | | | | | | | | | The purpose of this new `IMPORTED_GLOBAL` target-property is to prolong the lifetime and scope of `IMPORTED` targets in such a way as if they had been created with the keyword `GLOBAL` in the first place. * It can only be set to `TRUE`. That means, a local `IMPORTED` target can be promoted to global scope but a global `IMPORTED` target cannot be degraded to local scope! * Setting it to `TRUE` only succeeds if done from within the same directory in which the `IMPORTED` target was created in the first place. Fixes #17256.
* cmTarget: Simplified and fixed a string-comparision.Deniz Bahadir2017-11-031-1/+1
| | | | | | | | Before this change, `cmTarget::CheckProperty` accepted several strings as valid properties, including all strings prefixed with "INTERFACE_LINK_LIBRARIES". Now, that particular string is still accepted but other strings prefixed with that string are no longer accepted.
* Do not initialize NO_SYSTEM_FROM_IMPORTED on INTERFACE librariesBrad King2017-10-131-4/+1
| | | | | | | | | | | | | | The change in commit v3.8.0-rc1~276^2 (Allow NO_SYSTEM_FROM_IMPORTED on imported INTERFACE libraries, 2016-11-21) was incorrect. The property is not meant to be set on imported targets at all. It is meant to be set on their consumers that compile sources. Since INTERFACE libraries have no sources to compile, the property is not needed on them. Revert most of that change. Unfortunately we must still tolerate project code setting NO_SYSTEM_FROM_IMPORTED on INTERFACE libraries because they were allowed by CMake 3.8 and 3.9. Issue: #17348
* Autogen: Add (CMAKE_)AUTOMOC_COMPILER_PREDEFINESSebastian Holtermann2017-09-291-0/+1
|
* Performance: Improve efficiency of source file lookup in cmMakefileAaron Orenstein2017-09-201-0/+1
| | | | Add an unordered map to cmMakefile to speed up GetSource() lookups.
* cmSourceFileLocation: Drop unnecessary copy-assignment operatorAaron Orenstein2017-09-201-2/+3
| | | | Update the one place that used it to avoid needing assignment.
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-2/+2
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-26/+17
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-1/+1
|
* Add properties to run cppcheck along with the compilerBill Hoffman2017-08-301-0/+2
| | | | | | Create a `<LANG>_CPPCHECK` target property (initialized by a `CMAKE_<LANG>_CPPCHECK` variable) to specify a `cppcheck` command line to be run along with the compiler.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-92/+92
|
* Use C++11 unordered containersDaniel Pfeifer2017-08-221-2/+2
|
* Autogen: Add AUTOMOC_MACRO_NAMES supportSebastian Holtermann2017-08-181-0/+1
| | | | Closes #17176
* CUDA: Add option to run the compiler through launcher toolsBrad King2017-06-091-0/+1
| | | | | | | | Add a `CUDA_COMPILER_LAUNCHER` target property like those added for C and CXX by commit v3.4.0-rc1~450^2 (Add options to launch the compiler through tools like ccache or distcc, 2015-06-04). Fixes: #16953
* Access string npos without instancePavel Solodovnikov2017-06-011-1/+1
|