set_source_file_properties itself is not inherently scoped, but you are using a partial relative file name for it, so of course that name is inherently locally scoped....<div><br></div><div>Use a full path name instead, and the source file property will &quot;stick&quot; to that full path name.</div>
<div><br></div><div>(i.e. -- use &quot;${CMAKE_CURRENT_SOURCE_DIR}/subdir/test.c&quot; or &quot;${CMAKE_CURRENT_SOURCE_DIR}/test.c&quot; to refer to the file instead...)</div><div><br></div><div><br></div><div>HTH,</div><div>
David</div><div><br></div><div><br><div class="gmail_quote">On Fri, Mar 19, 2010 at 6:42 PM, Simmons, Aaron <span dir="ltr">&lt;<a href="mailto:asimmons@rosettastone.com">asimmons@rosettastone.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I&#39;m having trouble using set_source_files_properties from a subdirectory.  Say I have a top-level CMakeLists.txt like this:<br>

        cmake_minimum_required(VERSION 2.8)<br>
        project(test)<br>
        add_subdirectory(subdir)<br>
        get_source_file_property( temp subdir/test.c COMPILE_FLAGS )<br>
        message(&quot;reading property from toplevel= ${temp}&quot;)<br>
<br>
and I have a subdir/CMakeLists.txt like this:<br>
        set_source_files_properties( subdir/test.c PROPERTIES COMPILE_FLAGS &quot;-DBLAHBLAH&quot;)<br>
        get_source_file_property( temp subdir/test.c COMPILE_FLAGS )<br>
        message(&quot;reading property from subdir= ${temp}&quot;)<br>
<br>
then the output of cmake will be:<br>
        reading property from subdir= -DBLAHBLAH<br>
        reading property from toplevel= NOTFOUND<br>
<br>
Are source file properties inherently local scope?  Is there any way to specify the scope (like you can for the &quot;set&quot; function)?<br>
<br>
<br>
<br>
Thanks,<br>
aaron<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>