On Fri, Sep 16, 2011 at 11:11 AM, Michael Hertling <[email protected]> wrote: > On 09/16/2011 02:59 AM, Campbell Barton wrote: >> Hi, I would expect this would work from reading the docs but it gives >> >> add_executable(mytarget ${SRC}) >> get_property(TESTPROP_A TARGET mytarget PROPERTY SOURCE) >> get_target_property(TESTPROP_B mytarget SOURCE) >> message(FATAL_ERROR "Testing ${TESTPROP_A}, ${TESTPROP_B}") >> >> The output I get is: >> >> Testing '', 'TESTPROP_B-NOTFOUND' >> >> This is odd since properties "TYPE" and "LOCATION" are found >> >> Obviously in this case ${SRC} is already available, but I'm just >> trying to figure out why it fails. >> >> tested on cmake 2.8.5 > > The property you probably refer to is named SOURCES, not SOURCE. The > different results returned by GET_PROPERTY() and GET_TARGET_PROPERTY() > are documented: The former returns an empty value if the property isn't > set, and the latter returns the NOTFOUND value, both evaluating to FALSE. > > Regards, > > Michael
Ack!, sorry for the dumb mistake, but now I'm faced with a different problem. Getting the sources for a library defined in another directory, and it gives me relative paths. How do you get the path a library is defined in so I can make the absolute paths? - tried LOCATION but this gives the output location. PREFIX, SUFFIX are not set. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
