Re: [cmake-developers] [PATCH v3] FindHDF5.cmake HDF5_VERSION Support
Huebl, Axel wrote: I personally also tend to the cropped HDF5_VERSION for consistency and ease-of-use in environments using stable versions of HDF5 (most distributions). That doesn't mean we could not provide and *additional* HDF5_VERSION_STRING. For sake of consistency, I am not sure how to provide a -somestring extension to HDF5_VERSION that cmake's compare operators such as VERSION_LESS would understand (and/or ignore). I guess that is not possible and would introduce an inconsistency between the string HDF5_VERSION_STRING and the quasi-numeric variable HDF5_VERSION. VERSION_LESS and friends already ignore the extra parts, that is why you only need one variable. Eike -- signature.asc Description: This is a digitally signed message part. -- 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
Re: [cmake-developers] [PATCH v3] FindHDF5.cmake HDF5_VERSION Support
On 13.05.2015 16:04, Brad King wrote: On 05/13/2015 08:20 AM, Brad King wrote: We could also consider moving the .* inside the match group and then reporting the result in HDF5_VERSION_STRING instead of HDF5_VERSION. OTOH, HDF5 upstream distributes a CMake package configuration file allowing one to set HDF5_DIR. In this case find_package(HDF5) will provide HDF5_VERSION, so we should be consistent with that. I did have to update our topic for this after nightly testing because Fedora packages H5pubconf.h under a different name. I added a commit to check for a few name variants and then rebased the version patch on that: FindHDF5: Check for a few H5pubconf*.h name variants http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bd122ad FindHDF5: Add version support http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56858178 -Brad Brad, good catch with Fedora. The patch you provided fixes problems with correct parallel detection on that system, too - fantastic. (I just did some more research, similar configure scripts such as netcdf4-python check the same three files [1]). I personally also tend to the cropped HDF5_VERSION for consistency and ease-of-use in environments using stable versions of HDF5 (most distributions). That doesn't mean we could not provide and *additional* HDF5_VERSION_STRING. For sake of consistency, I am not sure how to provide a -somestring extension to HDF5_VERSION that cmake's compare operators such as VERSION_LESS would understand (and/or ignore). I guess that is not possible and would introduce an inconsistency between the string HDF5_VERSION_STRING and the quasi-numeric variable HDF5_VERSION. So probably cropping to the patch level of the version as we do it now is acceptable. Axel [1] https://netcdf4-python.googlecode.com/svn/trunk/setup.py -- 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 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
Re: [cmake-developers] [PATCH v3] FindHDF5.cmake HDF5_VERSION Support
On 05/13/2015 02:58 AM, Huebl, Axel wrote: Thanks for merging and adding the test, that is great. Thanks for working on the patch. On 05/11/2015 07:32 AM, Huebl, Axel wrote: I would simply use if( ${HDF5_VERSION_DEFINE} MATCHES H5_VERSION[ \t]+\([0-9]+\\.[0-9]+\\.[0-9]+).*\ ) to match the group correctly. We could also consider moving the .* inside the match group and then reporting the result in HDF5_VERSION_STRING instead of HDF5_VERSION. Many other find modules do this. The value can still be used for version testing but the full version string will be available for human reference. -Brad -- 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
Re: [cmake-developers] [PATCH v3] FindHDF5.cmake HDF5_VERSION Support
On 05/13/2015 08:20 AM, Brad King wrote: We could also consider moving the .* inside the match group and then reporting the result in HDF5_VERSION_STRING instead of HDF5_VERSION. OTOH, HDF5 upstream distributes a CMake package configuration file allowing one to set HDF5_DIR. In this case find_package(HDF5) will provide HDF5_VERSION, so we should be consistent with that. I did have to update our topic for this after nightly testing because Fedora packages H5pubconf.h under a different name. I added a commit to check for a few name variants and then rebased the version patch on that: FindHDF5: Check for a few H5pubconf*.h name variants http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bd122ad FindHDF5: Add version support http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56858178 -Brad -- 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
Re: [cmake-developers] [PATCH v3] FindHDF5.cmake HDF5_VERSION Support
On 12.05.2015 16:06, Brad King wrote: On 05/12/2015 09:58 AM, Brad King wrote: Thanks. Applied with minor tweaks to the commit message plus a test suite update: FindHDF5: Add version support http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1150734 I revised the copyright block to fix the ModuleNotices test: FindHDF5: Add version support http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58d6709e -Brad Thanks for merging and adding the test, that is great. Thank you Brad and Eike for the review! Axel 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
Re: [cmake-developers] [PATCH v3] FindHDF5.cmake HDF5_VERSION Support
On 05/12/2015 09:58 AM, Brad King wrote: Thanks. Applied with minor tweaks to the commit message plus a test suite update: FindHDF5: Add version support http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1150734 I revised the copyright block to fix the ModuleNotices test: FindHDF5: Add version support http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58d6709e -Brad -- 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
Re: [cmake-developers] [PATCH v3] FindHDF5.cmake HDF5_VERSION Support
On 05/11/2015 09:22 AM, Huebl, Axel wrote: This commit adds VERSION support for HDF5 from the same sources as it adds the HDF5_IS_PARALLEL flag. Thanks. Applied with minor tweaks to the commit message plus a test suite update: FindHDF5: Add version support http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1150734 -Brad -- 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
Re: [cmake-developers] [PATCH v3] FindHDF5.cmake HDF5_VERSION Support
This commit adds VERSION support for HDF5 from the same sources as it adds the HDF5_IS_PARALLEL flag. Previously posted on https://github.com/Kitware/CMake/pull/153 and improved with feedback from - Brad King - Rolf Eike Beer --- Modules/FindHDF5.cmake | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 0d58e13..2a92f5c 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -51,6 +51,7 @@ # bindings. # HDF5_LIBRARIES - Required libraries for all requested bindings # HDF5_FOUND - true if HDF5 was found on the system +# HDF5_VERSION - HDF5 version in format Major.Minor.Release # HDF5_LIBRARY_DIRS - the full set of library directories # HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support # HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler @@ -60,6 +61,7 @@ #= # Copyright 2009 Kitware, Inc. +# 2015 Axel Huebl, Helmholtz-Zentrum Dresden - Rossendorf # # Distributed under the OSI-approved BSD License (the License); # see accompanying file Copyright.txt for details. @@ -335,6 +337,7 @@ if( NOT HDF5_FOUND ) # If the HDF5 include directory was found, open H5pubconf.h to determine if # HDF5 was compiled with parallel IO support set( HDF5_IS_PARALLEL FALSE ) +set( HDF5_VERSION ) foreach( _dir IN LISTS HDF5_INCLUDE_DIRS ) if( EXISTS ${_dir}/H5pubconf.h ) file( STRINGS ${_dir}/H5pubconf.h @@ -343,6 +346,16 @@ if( NOT HDF5_FOUND ) if( HDF5_HAVE_PARALLEL_DEFINE ) set( HDF5_IS_PARALLEL TRUE ) endif() +unset(HDF5_HAVE_PARALLEL_DEFINE) + +file( STRINGS ${_dir}/H5pubconf.h +HDF5_VERSION_DEFINE +REGEX ^[ \t]*#[ \t]*define[ \t]+H5_VERSION[ \t]+ ) +if( ${HDF5_VERSION_DEFINE} MATCHES +H5_VERSION[ \t]+\([0-9]+\\.[0-9]+\\.[0-9]+).*\ ) +set( HDF5_VERSION ${CMAKE_MATCH_1} ) +endif() +unset(HDF5_VERSION_DEFINE) endif() endforeach() set( HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL @@ -357,8 +370,8 @@ if( NOT HDF5_FOUND ) endif() -find_package_handle_standard_args( HDF5 DEFAULT_MSG -HDF5_LIBRARIES -HDF5_INCLUDE_DIRS +find_package_handle_standard_args( HDF5 +REQUIRED_VARS HDF5_LIBRARIES HDF5_INCLUDE_DIRS +VERSION_VAR HDF5_VERSION ) -- 2.1.4 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