[cmake-developers] Patch to only consider build dependencies between files in the source directory

Attila Krasznahorkay attila.krasznahorkay at gmail.com
Tue Mar 22 08:23:30 EDT 2016


Dear Both,

Here is my next attempt. ;-) Hopefully I'm at least getting closer...

Cheers,
              Attila

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Introducing-the-CMAKE_DEPENDS_IN_PROJECT_ONLY-variab.patch
Type: application/octet-stream
Size: 4972 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160322/c9e4e27f/attachment-0001.obj>
-------------- next part --------------


> On 18 Mar 2016, at 16:57, David Cole <DLRdave at aol.com> wrote:
> 
> Brad's point with "/" or null terminator was that the directory name
> **must** be the directory itself, or a sub-directory of the one in
> question.
> 
> i.e.
> 
> if it's "my/src"
> 
> then it should either be exactly "my/src" or "my/src/someSubDir" , not
> "my/srcSiblingDir"
> 
> 
> 
> 
> On Fri, Mar 18, 2016 at 11:52 AM, Attila Krasznahorkay
> <attila.krasznahorkay at gmail.com> wrote:
>> Hi Brad,
>> 
>>>> +      // If it's an absolute path, check if it starts with the source
>>>> +      // direcotory:
>>>> +      return ( ( path.find( SourceDir ) != 0 ) &&
>>>> +               ( path.find( BinaryDir ) != 0 ) );
>>> 
>>> Please look at using strncmp and a check that the following character
>>> is a nul terminator or '/'.  Otherwise an external location with
>>> a common prefix may be mistaken for part of the project.
>> 
>> Not sure what scenario you have in mind here. :-/ std::string::find should only return 0 if the source directory path or binary directory path is what the evaluated path begins with. Why should we worry what the path continues with?
>> 
>> I was wondering about possibly using strncmp, but thought that performance-wise std::string::find should be fine as well here.
>> 
>> I'm not at all against changing the code, I just don't understand yet what setup the current code would not handle correctly.
>> 
>>> Also please add documentation in a
>>> 
>>> Help/variable/CMAKE_DEPENDS_IN_PROJECT_ONLY.rst
>>> 
>>> file and update Help/manual/cmake-variables.7.rst to reference it.
>> 
>> Will do. Was just not sure where to add this documentation.
>> 
>> Cheers,
>>            Attila
>> --
>> 
>> 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



More information about the cmake-developers mailing list