With David's patch and the above SOURCE_DIR property, it looks like
the necessary pieces are now present for target + source processing.
A quick test:

get_cmake_property(target_list TARGETS)
list(SORT target_list)
foreach(targ ${target_list})
  get_target_property(ttype ${targ} TYPE)
  if (NOT "${ttype}" STREQUAL "UTILITY")
    message("checking files of ${targ}(${ttype}): ")
    get_target_property(tdir ${targ} SOURCE_DIR)
    get_target_property(tsrcs ${targ} SOURCES)
    foreach(fsrc ${tsrcs})
      if(NOT EXISTS ${tdir}/${fsrc})
        message("NOT PRESENT: ${tdir}/${fsrc}")
      else(NOT EXISTS ${tdir}/${fsrc})
        message("found: ${tdir}/${fsrc}")
      endif(NOT EXISTS ${tdir}/${fsrc})
    endforeach(fsrc ${tsrcs})
  endif (NOT "${ttype}" STREQUAL "UTILITY")
endforeach(targ ${target_list})

returns the expected results, finding files that are present in the
source directories and listed in the target definition with a relative
path.  Very nice!  I believe this combination of abilities will also
allow me to avoid the add_subdirectory wrapping, since the set of
directories from all targets should be pretty close to the set of
directories added via add_subdirectory (warrants a quick test, but
probably close enough.)

CY
-- 

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-developers

Reply via email to