View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013263CMakeCMakepublic2012-06-01 08:412016-06-10 14:31
ReporterAndreas Mohr 
Assigned ToKitware Robot 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
Platformx86OSLinuxOS VersionRHEL5
Product VersionCMake 2.8.8 
Target VersionFixed in Version 
Summary0013263: SOURCES target property (get_property()) has very inconsistent result - wildly differing path specifications
DescriptionThe appended sample yields the following output:

[amoh@lxamoh build]$ cmake ..
tgt_sources main.cpp;[TEST_ROOT]/get_property_sources_broken_paths/test.rc;blubb.tas
-- Configuring done
CMake Error at CMakeLists.txt:17 (add_library):
  Cannot find source file:

    blubb.tas

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx


-- Build files have been written to: [TEST_ROOT]/get_property_sources_broken_paths/build


Note the very inconsistent items in the tgt_sources line shown above:
For (I assume) all language-related files a project-*relative* path will be preserved, whereas for *existing* foreign-language files the *absolute* path to the project-contained file (due to the result returned by the existence check?) will be delivered, plus for *non-existing* foreign-language files the *relative* path will be returned.

Whoa.

Since AFAIK it is recommended practice to add all files within a project to the target (well, at least *.c* and *.h*, maybe NOT *.rc* and other more foreign files?), this inconsistency is an annoying PROBLEM if detected, and a very annoying BUG if undetected.

Thanks!
Steps To Reproducecmake_minimum_required(VERSION 2.6)

project(get_property_sources_broken_paths)

file(WRITE main.cpp "
int main()
{
  #include \"get_property_sources_broken_paths.h\"

  return 0;
}
")

file(WRITE test.rc "")

#add_executable(get_property_sources_broken_paths main.cpp test.rc blubb.tas)
add_library(get_property_sources_broken_paths SHARED main.cpp test.rc blubb.tas)

get_property(tgt_sources TARGET get_property_sources_broken_paths PROPERTY SOURCES)

message("tgt_sources ${tgt_sources}")
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0030432)
David Cole (manager)
2012-08-11 21:42

Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0042056)
Kitware Robot (administrator)
2016-06-10 14:28

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2012-06-01 08:41 Andreas Mohr New Issue
2012-08-11 21:42 David Cole Status new => backlog
2012-08-11 21:42 David Cole Note Added: 0030432
2016-06-10 14:28 Kitware Robot Note Added: 0042056
2016-06-10 14:28 Kitware Robot Status backlog => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:28 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team