MantisBT - CMake
View Issue Details
0014775CMakeModulespublic2014-02-26 07:462014-10-06 10:32
Nikolay Orliuk 
Brad King 
normalfeatureN/A
closedfixed 
CMake 2.8.12.2 
CMake 3.1CMake 3.1 
0014775: GTEST_ADD_TESTS from FindGTest may find sources automatically
We can use get_target_property() for SOURCES property of executable.

See attached patch.
No tags attached.
patch 0002-FindGTest-detect-sources-automatically.patch (1,749) 2014-02-26 07:48
https://public.kitware.com/Bug/file/5082/0002-FindGTest-detect-sources-automatically.patch
patch 0001-FindGTest-Optionally-detect-sources-automatically-14.patch (1,901) 2014-02-26 09:21
https://public.kitware.com/Bug/file/5084/0001-FindGTest-Optionally-detect-sources-automatically-14.patch
Issue History
2014-02-26 07:46Nikolay OrliukNew Issue
2014-02-26 07:48Nikolay OrliukFile Added: 0002-FindGTest-detect-sources-automatically.patch
2014-02-26 08:30Stephen KellyNote Added: 0035205
2014-02-26 09:02Stephen KellyNote Added: 0035206
2014-02-26 09:21Brad KingFile Added: 0001-FindGTest-Optionally-detect-sources-automatically-14.patch
2014-02-26 09:22Brad KingNote Added: 0035207
2014-02-26 23:02Nikolay OrliukNote Added: 0035212
2014-02-27 08:55Brad KingNote Added: 0035213
2014-02-27 08:55Brad KingAssigned To => Brad King
2014-02-27 08:55Brad KingStatusnew => resolved
2014-02-27 08:55Brad KingResolutionopen => fixed
2014-02-27 08:55Brad KingFixed in Version => CMake 3.1
2014-02-27 08:55Brad KingTarget Version => CMake 3.1
2014-10-06 10:32Robert MaynardNote Added: 0036919
2014-10-06 10:32Robert MaynardStatusresolved => closed

Notes
(0035205)
Stephen Kelly   
2014-02-26 08:30   
It would be better to create an IMPORTED INTERFACE target for it and populate the INTERFACE_SOURCES property. That won't be possible until the INTERFACE_SOURCES property feature is complete.
(0035206)
Stephen Kelly   
2014-02-26 09:02   
Hmm, my comment above is not really relevant. I didn't understand the issue before commenting.
(0035207)
Brad King   
2014-02-26 09:22   
I've revised the patch slightly as

 0001-FindGTest-Optionally-detect-sources-automatically-14.patch

Please try this version.
(0035212)
Nikolay Orliuk   
2014-02-26 23:02   
Brad King, yep that works too.
(0035213)
Brad King   
2014-02-27 08:55   
Applied, thanks:

 FindGTest: Optionally detect sources automatically
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c50325b8 [^]
(0036919)
Robert Maynard   
2014-10-06 10:32   
Closing resolved issues that have not been updated in more than 4 months.