On 08.05.2015 17:52, Rolf Eike Beer wrote:
> Huebl, Axel wrote:
>> This commit adds VERSION support for HDF5 from
>> the same sources as it adds the HDF5_IS_PARALLEL
>> flag.
> 
>> @@ -343,6 +346,14 @@ if( NOT HDF5_FOUND )
>>              if( HDF5_HAVE_PARALLEL_DEFINE )
>>                  set( HDF5_IS_PARALLEL TRUE )
>>              endif()
>> +
>> +            file( STRINGS "${_dir}/H5pubconf.h"
>> +                HDF5_VERSION_DEFINE
>> +                REGEX "#define H5_VERSION" )
> 
> I suggest using "#define[ \t]+H5_VERSION[ \t]+": this works also on changed 
> indendation and does not accidentially match H5_VERSION_FOO.
> 
>> +            if( "${HDF5_VERSION_DEFINE}" MATCHES
>> +                "H5_VERSION[ \t]+\"([0-9]+\\.[0-9]+\\.[0-9]+)\"" )
>> +                set( HDF5_VERSION "${CMAKE_MATCH_1}" )
>> +            endif()
> 
> please unset HDF5_VERSION_DEFINE here.
> 
> Greetings,
> 
> Eike
> 

Thank you for the feedback.

Good points, I agree!
Shall I unset HDF5_HAVE_PARALLEL_DEFINE for sake of consistency, too?

The second regex should avoid matching "H5_VERSION_FOO" anyway, even if
it would include several lines in the beginning.

More general would be
  "^[ \t]*#[ \t]*define[ \t]+H5_VERSION[ \t]+"

but the question will be how far we should obfuscate it, I guess :)


Greetings,
Axel

-- 

Axel Huebl
Phone +49 351 260 3582
https://www.hzdr.de/crp
Computational Radiation Physics
Laser Particle Acceleration Division
Helmholtz-Zentrum Dresden - Rossendorf e.V.

Bautzner Landstrasse 400, 01328 Dresden
POB 510119, D-01314 Dresden
Vorstand: Prof. Dr.Dr.h.c. R. Sauerbrey
          Prof. Dr.Dr.h.c. P. Joehnk
VR 1693 beim Amtsgericht Dresden

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

-- 

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

Reply via email to