> Use a full path name instead, and the source file
> property will "stick" to that full path name.
I've changed the CMakeLists to use the full file path as suggested, but it
doesn't work. Am I missing something? The code is below...
Top-level CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project(test)
set(src ${CMAKE_CURRENT_SOURCE_DIR}/subdir/test.c)
add_subdirectory(subdir)
get_source_file_property( temp ${src} COMPILE_FLAGS )
message("(top) reading property from ${src}= ${temp}")
Subdir CMakeLists.txt:
set(src ${CMAKE_CURRENT_SOURCE_DIR}/test.c)
set_source_files_properties( ${src} PROPERTIES COMPILE_FLAGS
"-DBLAHBLAH")
get_source_file_property( temp ${src} COMPILE_FLAGS )
message("(sub) reading property from ${src}= ${temp}")
Output:
(sub) reading property from
/Users/asimmons/Development/test/cmake/subdir/test.c= -DBLAHBLAH
(top) reading property from
/Users/asimmons/Development/test/cmake/subdir/test.c= NOTFOUND
Thanks,
aaron
_______________________________________________
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