[CMake] Common binary dir and failed local headers dependencies

Wojciech Migda wojtek.golf at interia.pl
Sat Mar 7 12:42:09 EST 2009


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 ?

BR,

Wojtek


Wojciech Migda pisze:
> some follow-up to my previous post:
>
> I don't see an easy way to fix the presented problem within cmake
> scripting mechanisms other than adding own script called at the setup
> time for dependencies check and adding those dependencies to objects
> using SET_PROPERTIES* directives.
>
> However, as far as I could look into cmake code myself, the change I'd
> see being made was an interpretation of the "." directory added using
> the INCLUDE_DIRECTORIES directive. CMake inserts "." to the list of
> include dirs stored in CMakeDirectoryInformation.cmake but then when it
> comes to dependency resolution in the cmDependsC::WriteDependencies
> method the "." directory is interpreted literally, that is the path to
> the header being checked for existence is simply its filename, assuming
> the current directory for its location. Thus, if the dependencies are
> checked using the "cmake -E cmake_depends" (as in any build.make file)
> the current directory is the topmost project folder. Instead "." shall
> be translated to the current target source folder, taken as one of the
> arguments of "cmake -E cmake_depends" arguments: start-src-dir.
>
> Any thoughts on that ?
>
> Wojtek Migda
>
>
>
>
> ----------------------------------------------------------------------
> 8 marca - wyslij kwiaty bliskim Ci kobietom! >>> http://link.interia.pl/f208f
>
> _______________________________________________
> 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
>
>
>   


----------------------------------------------------------------------
Program tylko dla graczy komputerowych! 
Ogladaj >>> http://link.interia.pl/f207f 



More information about the CMake mailing list