Commit Graph

22 Commits

Author SHA1 Message Date
Tobias Hunger
2da7d205d4 CMake: Add LD_LIBRARY support
Extract all the information necessary for the "Add build library search path
to LD_LIBRARY_PATH" from fileapi and enable the relevant UI in the
desktop run configuration.

This allows to remove a workaround introduced for QTCREATORBUG-19354.

Note that this is only supported by fileapi at this time.

Task-number: QTCREATORBUG-23464
Change-Id: I390d26ed8cd559bd7ff8c2701cd3b1cb8e764339
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-22 12:23:22 +00:00
Tobias Hunger
c9a1be7fe4 CMake: Support nested source_groups
Support nesting of source groups based on the source group name, split
at "\\" strings.

Change-Id: I6c0e5c64b2b4ee84cd07cde1ff5accc5c3b853df
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-14 15:40:54 +00:00
Tobias Hunger
9280f7f757 CMake: Improve handling of source_groups
* Use a special icon for source groups, so that those can get
  destinguished from folders
* Simplify folder structure below source groups to not include
  common paths elements

Task-number: QTCREATORBUG-23372
Change-Id: Ifcb35af9b35805a6272f27b0801c2fe7dfce95ae
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-14 15:39:48 +00:00
Eike Ziller
92546d0983 Merge remote-tracking branch 'origin/4.11'
Change-Id: I0657cee6b87eea7b3178548bebed85d5ac824519
2020-01-03 08:57:33 +01:00
Tobias Hunger
32018623a4 CMake: Nest nodes below SourceGroups in Project tree
Task-number: QTCREATORBUG-23372
Change-Id: I8eccc7b9ce812b3abc9bf3e0057aa9d572f4faf8
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-12-20 15:46:11 +00:00
Tobias Hunger
0dbe6f8e3c CMake: Add heuristics to set "Run in Terminal" flag
For CMake file-api, flag all applications not linking to "QtXGui"
as "Run in Terminal".

Task-number: QTCREATORBUG-21451
Change-Id: I29f086c546d3d8a9f56257e423602f787db42ccd
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-12 14:55:17 +00:00
Cristian Adam
8ee22dd597 CMakeProjectManager: Fix clang code model when CMake PCHs are used
CMake gives the path to the cmake_pch.h[xx] file as relative path
to build directory. Making it absolute fixes the code model.

Fixes: QTCREATORBUG-22888
Change-Id: I2fdc080be779f22b737788be2074254290994aaa
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-10-22 08:12:26 +00:00
Tobias Hunger
a33cb335f7 CMake: Fileapi: Make ids unique per compile group
Make sure to generate unique ids for each project part to unconfuse the
code model.

This was never triggered so far since before PCH support all my test projects
ended up with exactly one compile group per target:-)

Change-Id: Ida34f71f77cdf679fea7007f13ac19713175d916
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-09-19 09:53:52 +00:00
Tobias Hunger
454261aaa2 CMake: Support pre-compiled headers in CMake fileapi reader
Adding this to other readers makes no sense: PCH support in cmake
is younger than fileapi.

Change-Id: I4cd88882764ab8a8f81316a17098878c8e3699eb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-09-19 09:52:53 +00:00
Eike Ziller
9cc45fe1fb CppTools: Move RawProjectPart to ProjectExplorer
Doesn't have any dependencies into CppTools anymore, therefore moving it
reduces the dependencies of the project managers to CppTools as well.

Change-Id: Ibe728abe59eb88a8877943dca1f48a85163e27ac
Reviewed-by: hjk <hjk@qt.io>
2019-09-11 06:22:12 +00:00
Eike Ziller
8452264a18 CppTools: Move QtVersion and BuildTargetType
QtVersion to utils/cpplanguage_details.h which already contains similar
flags.

BuildTargetType to ProjectExplorer, next to BuildTargetInfo (but not in the
same header to not pull that in everywhere).

Removes dependency on ProjectPart from RawProjectPart.

Change-Id: I5791065e4266f20c2657ee4b1b594df04b238a1c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-10 07:31:21 +00:00
Tobias Hunger
4aee38e04c CMake: Extract and show more CMake location information for targets
Report more cmake file locations that are relevant to a target in
the "Open..." menu entry in the target's context menu.

This information is extracted from the backtrace information that
is provided by fileapi.

Change-Id: I01659a6cc7254cd0ef6b533a0785d2f15d31c3c6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-07-29 08:46:53 +00:00
Tobias Hunger
9ae4510e27 ProjectNodes: Use QVector instead of QList for LocationInfo
Change-Id: I5bad9e1849b9d752de24626013c9102242d11a0a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-07-29 08:45:08 +00:00
Tobias Hunger
4daba5a9fa CMake: Fix working directory for targets in fileapi mode
Prepend the full path to the build directory.

Change-Id: I55111b656fd4b99ee68517c09117f142e88947b1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-26 11:49:01 +00:00
Tobias Hunger
ec92784778 CMake: Report absolute paths to executables in fileapi mode
Task-number: QTCREATORBUG-22610
Change-Id: Ib6abf1ce6d94abd9dc063f4f559f02f2d4ea8798
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-07-25 13:19:11 +00:00
Tobias Hunger
69b3d90683 CMake: Remember file location of CMake target definitions
Make fileapi remember where CMake targets were defined in the
CMakeBuildTarget struct. The other readers will just guess at
the location based on the source directory of the target.

Change-Id: Ia8fa226c548800992ccea64b1d5981d2f3013408
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-24 14:57:47 +00:00
hjk
5efa84b91f Replace remaining Utils::FileName occurrences by Utils::FilePath
Change-Id: Ic3120f18b4fbe90219de9128dba53d7453630b03
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 13:40:22 +00:00
Tobias Hunger
18eb0b39c5 CMake: Do not treat "Source Files" source file group special
The idea was to make the project tree a bit simpler by removing the
auto-generated "Source Files" group that CMake adds. But this left out
"Header Files", which is also auto-generated by CMake and might
surprise users.

So let's remove this special case again.

Change-Id: If87bf9f89e1ff0be855c2e9b915d64d77d51d2be
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-21 09:37:36 +00:00
Nikolai Kosjar
b6a9f0245b CMake: Fix warning about unsigned expression
warning: comparison of unsigned expression >= 0 is always true

Change-Id: I0a794bd7aa27a8a23094db4d95c676080b6a63b6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-06-21 07:18:01 +00:00
Tobias Hunger
5bcd59c94f CMake: Simplify buildkey generation
Just use the target name as buildkey. This is unique in cmake projects, so
there is no need to mangle the source directory into the whole thing.

This is a problem since different readers might report different source
directories. That will then result in RunConfigurations getting duplicated
after switching the reader types.

Task-number: QTCREATORBUG-22129
Change-Id: I849ab68f221d732341e98faa9a4e757d3a495b2a
Reviewed-by: hjk <hjk@qt.io>
2019-06-20 14:41:04 +00:00
Tobias Hunger
add60c0148 CMake: Avoid a bit of useless processing when updating the project tree
Do not pass around a list of filenodes with all the known header files.
That list gets converted into a QSet<FilePath> and then that is used.

Just generate the QSet<FilePath> directly and avoid that conversion.

Change-Id: I2444a2a6b4a1600fe476e66673a1a2e9c8900764
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-06-20 14:40:55 +00:00
Tobias Hunger
a95eb53d3b CMake: Add initial fileapireader class
Change-Id: I620cba7cc1c2a5ac56789fa9770dce573c6b19cd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-20 12:25:36 +00:00