1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-21 04:01:40 +08:00

1176 Commits

Author SHA1 Message Date
Sebastian Holtermann
ccf76c6e4c cmTarget: Move member TLLCommands to impl 2019-03-23 21:45:10 +01:00
Sebastian Holtermann
7742bf4ff5 cmTarget: Move member Backtrace to impl 2019-03-23 21:45:09 +01:00
Sebastian Holtermann
2c14eb4852 cmTarget: Move member PolicyMap to impl 2019-03-23 21:45:09 +01:00
Sebastian Holtermann
f6241db3e0 cmTarget: Move member OriginalLinkLibraries to impl 2019-03-23 21:45:09 +01:00
Sebastian Holtermann
3c09bf0fa7 cmTarget: Move member Utilities to impl 2019-03-23 21:45:09 +01:00
Sebastian Holtermann
856a271fb7 cmTarget: Move member SystemIncludeDirectories to impl 2019-03-23 21:45:09 +01:00
Sebastian Holtermann
46075091d5 cmTarget: Move member Properties to impl class 2019-03-23 21:15:32 +01:00
Sebastian Holtermann
2cd4104600 cmTarget: Move member Makefile to impl 2019-03-23 15:10:50 +01:00
Sebastian Holtermann
fa8e2dfc7b cmTarget: Move member TargetType to impl 2019-03-23 15:04:56 +01:00
Sebastian Holtermann
c9bd2e941f cmTarget: Rename member Internal to impl 2019-03-23 15:04:42 +01:00
Brad King
fb05b6a8f5 Merge topic 'cmTarget_micro_fixes'
965da8d787 cmTarget: Acquire data only when needed
03d17a35b5 cmTarget: Use helper function to append to lists

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3135
2019-03-22 09:19:09 -04:00
Harry Mallon
413b71485a Xcode: Create Xcode schemes per target 2019-03-21 16:50:41 +00:00
Sebastian Holtermann
965da8d787 cmTarget: Acquire data only when needed 2019-03-21 16:58:29 +01:00
Sebastian Holtermann
03d17a35b5 cmTarget: Use helper function to append to lists 2019-03-21 16:57:27 +01:00
Regina Pfeifer
9eb0e73f46 cmRange: Move to dedicated header file 2019-02-21 08:24:25 -05:00
Artur Ryt
706b93fa55 Modernize: C-arrays and loops over them
It replaces C arrays with deduced std::initializer_lists
or std::array what makes enables for-loop over them.
2019-02-15 23:40:30 +01:00
Artur Ryt
01b2d6ab74 Modernize: Use ranged for-loops when possible
Replaced most manual `const_iterator`-based loops and some
reverse-iterator loops with range loops.

Fixes: #18858
2019-02-07 22:39:05 +01:00
Bruno Manganelli
b6a957c969 cmOutputConverter: move ConvertToRelativePath to cmStateDirectory. 2019-01-27 15:48:57 +00:00
Brad King
1fba410ecf Merge topic 'autogen_mocs_compilation_first'
1ed4d48dcf Autogen: Prepend instead of append `mocs_compilation.cpp` to the sources list
a42b700cc2 cmTarget,cmGeneratorTarget: Add optional `before` parameter to AddSource

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Peter Wu <peter@lekensteyn.nl>
Merge-request: !2815
2019-01-21 07:53:23 -05:00
Sebastian Holtermann
a42b700cc2 cmTarget,cmGeneratorTarget: Add optional before parameter to AddSource
The new optional `before` parameter in `cmTarget::AddSource` and
`cmGeneratorTarget::AddSource` allows to prepend a source file
to the sources list instead of appending it.
2019-01-18 13:47:23 +01:00
Regina Pfeifer
ef61997b1b clang-tidy: Use emplace 2019-01-17 13:12:02 -05:00
Bruno Manganelli
cc2a5261f8 Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
2019-01-16 08:16:31 -05:00
Artur Ryt
ecf6fc8dc1 cmTarget: Remove unused classes cmTargetSet and cmTargetManifest 2018-12-06 11:40:13 -05:00
Cengizhan Pasaoglu
c67ab22cdc Using front() and back() instead of calculations 2018-11-06 21:43:33 +03:00
Sebastian Holtermann
b5e895b5d4 Autogen: Add (CMAKE_)AUTOGEN_ORIGIN_DEPENDS support
This adds

- the variable ``CMAKE_AUTOGEN_ORIGIN_DEPENDS`` which initializes
- the target property ``AUTOGEN_ORIGIN_DEPENDS``

which controls whether or not the origin target dependencies
should be forwarded to the corresponding ``_autogen`` target.

The default value of ``CMAKE_AUTOGEN_ORIGIN_DEPENDS`` is ``ON``
which corresponds to the behavior that is in place since CMake 3.9.

Closes: #18493
2018-11-03 12:14:40 +01:00
Peter Wu
6114d85a7d RPATH: Add option for using $ORIGIN in build tree
This makes binaries independent of the build directory by not embedding
the build directory via RPATH.  The tests are partially based on the
existing RuntimePath test, but with the check moved into a POST_BUILD
command such that it can be skipped when the platform lacks support.

Fixes: #18413
2018-10-26 09:25:51 -04:00
Brad King
a6e02f881d add_dependencies: Track backtraces internally
Record backtraces for "utility" dependencies created by
`add_dependencies` calls.
2018-10-18 08:10:55 -04:00
Brad King
4e98203c6c Merge topic 'vs-global-props-for-all-targets'
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
2018-09-28 11:13:59 -04:00
Marc Chevrier
a71caab46b LINK_DIRECTORIES: Add new properties and commands
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
2018-09-25 23:59:58 +10:00
Marc Chevrier
5ca130e223 Refactoring: introduce function to check if a string is a generator expression 2018-09-25 23:46:56 +10:00
Mikhail Korolev
22e670a306 VS: Add option to set VS_GLOBAL_* for all targets
Fixes: #18287
2018-09-25 09:20:25 -04:00
Brad King
a8f628c0a4 Merge topic 'getsafedef-stdstring'
f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const&

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2350
2018-09-18 11:18:00 -04:00
Vitaly Stakhovsky
f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const& 2018-09-18 11:16:46 -04:00
Brad King
a1ad0a699b target_link_libraries: Allow use with targets in other directories
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
2018-09-12 13:06:36 -04:00
Brad King
9bbae5ae28 cmTarget: Future-proof AddLinkLibrary target lookup scope
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.
2018-09-12 12:46:51 -04:00
Vitaly Stakhovsky
c8fd23ec6f cmMakefile: return directories as const std::string& 2018-08-27 14:07:43 -04:00
Vitaly Stakhovsky
ada121e573 cmStateDirectory: use const std::string& for return values 2018-08-12 18:59:21 +10:00
Gregor Jasny
6b7f1e1db0 Xcode: Add variables and properties to configure schemes
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
2018-08-01 09:12:42 -04:00
Sebastian Holtermann
127094f2f0 Add GetSafeProperty method to cmTarget, cmGeneratorTarget and cmSourceFile 2018-07-02 12:39:54 +02:00
Marc Chevrier
c1f5a44b28 LINK_OPTIONS: Add new family of properties
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
2018-06-06 17:22:39 +02:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
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.
2018-06-01 09:53:42 -04:00
Michael Stürmer
71a033616a added CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION variable
Fixes: #17955
2018-05-15 09:00:31 +02:00
Brad King
a76e23eabb Merge topic 'variable-CMAKE_FOLDER'
df535ad846 Add CMAKE_FOLDER variable to initialize FOLDER target property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1896
2018-04-02 10:06:39 -04:00
Marc B
df535ad846 Add CMAKE_FOLDER variable to initialize FOLDER target property
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}")
2018-03-29 13:19:13 -04:00
Brad King
fd6c452986 cmTarget: Remove unused variable
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).
2018-03-28 11:09:56 -04:00
Brad King
fac050ec8d Merge topic 'update-dllplatform'
2dc2a3eb15 Identify DLL platforms via CMAKE_IMPORT_LIBRARY_SUFFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1832
2018-03-12 13:40:44 -04:00
Stephan Szabo
2dc2a3eb15 Identify DLL platforms via CMAKE_IMPORT_LIBRARY_SUFFIX
Use `CMAKE_IMPORT_LIBRARY_SUFFIX` to identify platforms that have DLL
import libraries rather than memorizing a list of platform names.

Fixes: #16801
2018-03-09 08:09:21 -05:00
Brad King
7723e9a058 Do not produce legacy _LIB_DEPENDS cache entries
Introduce policy `CMP0073` to avoid producing these cache entries.

Fixes: #16364
2018-03-07 07:48:40 -05:00
Brad King
2124a1364a cmTarget: Remove unnecessary RecordDependencies member
Inline the condition in the one remaining place it is checked.
2018-03-06 14:38:23 -05:00
Brad King
1c5bfab532 cmTarget: Simplify ClearDependencyInformation implementation
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
2018-03-06 14:38:16 -05:00