Am 20. Mai 2017 11:16:54 MESZ schrieb Urs Thuermann <[email protected]>:
>Craig Scott <[email protected]> writes:
>>     add_executable(foo foo.c)
>>     set_source_files_properties(foo.c PROPERTIES OBJECT_DEPENDS
>> ${CMAKE_BINARY_DIR}/tab.h)
>
>IMO that feels just wrong.  foo.c does NOT depend on tab.h, foo.c does
>not depend on anything, it's not even generated by the build system.
>*I* edit it.  Instead, it is the object file foo.o that depends on
>tab.h.  But it seems that cmake doesn't want the developer to see or
>talk about object files.  It hides them somewhere in subdirs (with
>unpredictable names (sometimes foo.o, sometimes a silly name like
>foo.c.o, sometimes both), so after make foo.o I don't know which one
>is current), gives error messages if I use them in CMakeLists.txt...

This is not quite correct.
Either your code generates a header file to be included by foo.c, then foo.c 
depends on it. Or it creates data and methods that need to be linked, then the 
executable depends on it.

An object file only makes the executable need unresolved symbols but that is 
not a dependency of the object file.

Or you simply failed to explain how parts relate to each other and the 
dependency between the parts is totally different.

OTOH, table-driven CRC is usually not that complicates to integrate.

CMake handles lots of compilers that REQUIRE other object file extensions than 
.o. It also generates for more that only make, allowing better working with 
IDEs. These bring their own strange rules that you cannot match to any make 
logic.

HS

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to