[CMake] targetname_BINARY_DIR?

Pau Garcia i Quiles pgquiles at elpauer.org
Mon Jan 17 21:47:22 EST 2011


Hello,

If I use:

project( blah )

that creates variables blah_SOURCE_DIR and blah_BINARY_DIR.

Does anything like that exist for a *target* ? I've managed to emulate
targetname_SOURCE_DIR with:

  get_target_property(${name}_SOURCEFILES ${name} SOURCES)
  list(GET ${name}_SOURCEFILES 0 ${name}_FIRST_SOURCEFILE )
  get_source_file_property(${name}_SUBDIR_FULLPATH
${${name}_FIRST_SOURCEFILE} LOCATION)
  string(REPLACE ${WT_SOURCE_DIR}/examples/ "" ${name}_SUBDIRANDSOURCE
${${name}_SUBDIR_FULLPATH})
  string(REPLACE /${${name}_FIRST_SOURCEFILE} "" ${name}_SUBDIR
${${name}_SUBDIRANDSOURCE})

However, I don't know how to emulate targetname_BINARY_DIR. I tried with:

  get_target_property(${name}_RUNTIME_OUTPUT_DIRECTORY ${name}
RUNTIME_OUTPUT_DIRECTORY)

But I get NOTFOUND :-(

Thank you

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)


More information about the CMake mailing list