This is becoming a challenge :-)<div><br></div><div>I'm generating .RC files using configure_file() in my CMake script. Since I can have multiple targets defined in the same directory, and the resource file generated for each target has the same name, I need them to be placed in the <target_name>.dir directory inside of CMAKE_CURRENT_BINARY_DIR. Right now I hard-code the path:</div>
<div><br></div><div>set( output_dir "${CMAKE_CURRENT_BINARY_DIR}/${target_name}.dir" )<br><br><div class="gmail_quote">On Thu, Jun 21, 2012 at 11:46 AM, J Decker <span dir="ltr"><<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Jun 21, 2012 at 9:26 AM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>> wrote:<br>
> You're totally confused. I'm not looking to work around a problem, I just<br>
> want information from CMake that I know it has. Somewhere it knows exactly<br>
> where binaries will be placed (those binaries that get compiled) because it<br>
> has to generate the scripts and visual studio projects with those paths<br>
> inside.<br>
><br>
> CMake is generating resource files that must be placed in these directories<br>
> and are later included in the targets to be compiled, so I need to know this<br>
> directory so that no matter what generator I'm using, the resource file will<br>
> always be copied to the proper location.<br>
><br>
<br>
</div>that's didn't help a lot :) what sort of resource files do you mean?<br>
Watcom .rc handling isn't great for instance, and I have custom rules<br>
to generate the .res output, but then I just specify that output.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> On Thu, Jun 21, 2012 at 11:07 AM, J Decker <<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>> wrote:<br>
>><br>
>> On Thu, Jun 21, 2012 at 8:58 AM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>><br>
>> wrote:<br>
>> > So how do I get the absolute path to this directory in a portable<br>
>> > (between<br>
>> > generators) way?<br>
>> ><br>
>> ><br>
>><br>
>> Well, what is it you want from there? I generate INSTALL commands to<br>
>> put the outputs where I want them and let them worry about where the<br>
>> files are?<br>
>><br>
>> > On Thu, Jun 21, 2012 at 9:03 AM, J Decker <<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>> wrote:<br>
>> >><br>
>> >> On Wed, Jun 20, 2012 at 12:08 PM, Robert Dailey<br>
>> >> <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>> wrote:<br>
>> >> > ${CMAKE_CURRENT_BINARY_DIR} returns a directory that contains<br>
>> >> > generated<br>
>> >> > files, such as vcproj files when generating for visual studio.<br>
>> >> > However,<br>
>> >> > actual compiled binaries are placed:<br>
>> >> ><br>
>> >> > ${CMAKE_CURRENT_BINARY_DIR}/${target_name}.dir/Debug (for debug<br>
>> >> > configuration)<br>
>> >> ><br>
>> >> > Is there a variable or target property that will give me the<br>
>> >> > following<br>
>> >> > path<br>
>> >> > for any target:<br>
>> >> ><br>
>> >> > ${CMAKE_CURRENT_BINARY_DIR}/${target_name}.dir<br>
>> >> ><br>
>> >> > (I don't care about debug/release being part of the path, I just want<br>
>> >> > the<br>
>> >> > "target.dir" part to be included in the path. Right now I'm<br>
>> >> > hard-coding<br>
>> >> > the<br>
>> >> > ".dir" directory and appending it to my path, but I don't know if<br>
>> >> > this<br>
>> >> > naming scheme is guaranteed by CMake or if it will change in the<br>
>> >> > future.<br>
>> >> ><br>
>> >> it differs from generator to generator<br>
>> >><br>
>> >> > --<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<br>
>> >> > <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:<br>
>> >> > <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>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>