[CMake] Common binary dir and failed local headers dependencies

Wojciech Migda wojtek.golf at interia.pl
Sun Mar 8 06:51:29 EDT 2009



Bill Hoffman pisze:
> Wojciech Migda wrote:
>   
>> Hi again,
>>
>> this workaround seems to do a trick:
>>
>> in cmDependsC::WriteDependencies I've added a local variable to store
>> path to the source file being scanned for dependencies:
>>
>> std::string root_dir =
>> cmSystemTools::GetFilenamePath(this->LocalGenerator->Convert(src,
>>       cmLocalGenerator::HOME_OUTPUT,
>>       cmLocalGenerator::MAKEFILE));
>>
>> later in the function I've replaced
>>
>>         if((*i) == ".")
>>           {
>>                 tempPathStr += current.FileName;
>>
>> with
>>
>>         if((*i) == ".")
>>           {
>>                 tempPathStr += root_dir + "/" + current.FileName;
>>
>> Could anyone from the cmake dev team evaluate this proposal ?
>>
>>     
>
> There are other things that will break because of this.  Things like 
> percent done.  The build directories were designed with the thought that 
> they should be unique.
>
> Try LIBRARY_OUTPUT_PATH to place the libraries, that is how it should be 
> done.
>
> -Bill
>   

thanks for a tip Bill,

seems to work, although I yet to have to check all the places where the
paths might become broken, but that is just a minor issue (we directly
refer in at least few points to specific object files, whose path will
now change - see below).
I've changed the ADD_SUBDIRECTORY invocations to refer to separate
binary folders within common binary one as
"${common_bin_dir}/${target_name}" (Mike Jackson has proposed this in
his response as well). Anyway, the dependencies are now handled properly
(as expected).

Thanks again,

Wojtek

----------------------------------------------------------------------

Zyskaj tak jak ja 9% na lokacie w pierwszym miesiacu! 
Sprawdz! http://link.interia.pl/f207b




More information about the CMake mailing list