From ce2d1ed49fb810a3fe8941088ad236428cdb9183 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 17 Dec 2015 11:11:42 +0000 Subject: [PATCH] ECBUILD-190: suppress deprecation messages --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 202dcd615..5e16b4133 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,8 +106,16 @@ set( HAVE_LIBOPENJPEG 0 ) if( ENABLE_JPG ) - #ecbuild_add_extra_search_paths( jasper ) # help standard cmake macro with ecmwf paths + # Note: This is a deprecated feature but we need it to find Jasper at ECMWF. + # ecbuild_add_extra_search_paths modifies CMAKE_PREFIX_PATH + # which can affect future package discovery if not undone by the caller. + # The current CMAKE_PREFIX_PATH is backed up as _CMAKE_PREFIX_PATH + # + set(ECBUILD_NO_DEPRECATIONS ON) # Suppress deprecation message + ecbuild_add_extra_search_paths( jasper ) find_package( Jasper ) + set(CMAKE_PREFIX_PATH ${_CMAKE_PREFIX_PATH}) # Restore CMAKE_PREFIX_PATH + set(ECBUILD_NO_DEPRECATIONS OFF) # Remove suppression find_package( OpenJPEG )