Skip to content

lcg_external_module: Add feature to find binaries

Frank Winklmeier requested to merge fwinkl/atlasexternals:valgrind into master

Teach the lcg_external_module to find binaries via the BINARY_NAMES and BINARY_SUFFIXES options analogous to what is already possible in lcg_python_external_module. This should reduce some boiler-plate code in various find-modules. For the moment I just added it to Findvalgrind (which fixes ATLINFR-1390).

Note that the nomenclature is a bit different than in lcg_python_external_module, i.e. it does not use a leading underscore for the BINARY_PATH variable to be consistent with the other variables (e.g. INCLUDE_DIR). However, this then has the side-effect that if one were to use

find_package_handle_standard_args( valgrind DEFAULT_MSG
   VALGRIND_BINARY_PATH VALGRIND_INCLUDE_DIR )

one gets an unsightly

 -- Found valgrind: $<BUILD_INTERFACE:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/sw/lcg/releases/LCG_96/valgrind/3.15.0/x86_64-centos7-gcc8-opt/bin>;$<INSTALL_INTERFACE:${LCG_RELEASE_BASE}/LCG_96/valgrind/3.15.0/x86_64-centos7-gcc8-opt/bin>  

during the cmake configuration. The work-around is simply to invert the order of the required vars as cmake only prints the first one for a successful find. I am open to better solution to this. I did not want to use the leading underscore for the PATH variable if the others don't use one.

Merge request reports