mirror of https://github.com/ecmwf/eccodes.git
GRIB-822 Export samples and definition paths for install and build trees
With ECBUILD-105 is is possible to check for build vs. install tree export in <package>-import.cmake scripts. Use this to export the correct GRIB_API_DEFINITION_PATH, GRIB_API_SAMPLES_PATH, GRIB_API_IFS_SAMPLES_PATH in grib_api-import.cmake for dependent projects to use.
This commit is contained in:
parent
53de0863c4
commit
6a626a235d
|
@ -186,19 +186,23 @@ endif()
|
||||||
# contents
|
# contents
|
||||||
|
|
||||||
if( NOT ${DEVELOPER_MODE} )
|
if( NOT ${DEVELOPER_MODE} )
|
||||||
set( grib_api_default_data_prefix ${CMAKE_INSTALL_PREFIX} )
|
set( the_default_data_prefix ${CMAKE_INSTALL_PREFIX} )
|
||||||
else()
|
else()
|
||||||
set( grib_api_default_data_prefix ${CMAKE_BINARY_DIR} )
|
set( the_default_data_prefix ${CMAKE_BINARY_DIR} )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set( ECCODES_DEFINITION_SUFF share/eccodes/definitions )
|
||||||
|
set( ECCODES_SAMPLES_SUFF share/eccodes/samples )
|
||||||
|
set( ECCODES_IFS_SAMPLES_SUFF share/eccodes/ifs_samples )
|
||||||
|
|
||||||
if( NOT DEFINED ECCODES_DEFINITION_PATH )
|
if( NOT DEFINED ECCODES_DEFINITION_PATH )
|
||||||
set( ECCODES_DEFINITION_PATH ${grib_api_default_data_prefix}/share/eccodes/definitions )
|
set( ECCODES_DEFINITION_PATH ${the_default_data_prefix}/${ECCODES_DEFINITION_SUFF} )
|
||||||
endif()
|
endif()
|
||||||
if( NOT DEFINED ECCODES_SAMPLES_PATH )
|
if( NOT DEFINED ECCODES_SAMPLES_PATH )
|
||||||
set( ECCODES_SAMPLES_PATH ${grib_api_default_data_prefix}/share/eccodes/samples )
|
set( ECCODES_SAMPLES_PATH ${the_default_data_prefix}/${ECCODES_SAMPLES_SUFF} )
|
||||||
endif()
|
endif()
|
||||||
if( NOT DEFINED ECCODES_IFS_SAMPLES_PATH )
|
if( NOT DEFINED ECCODES_IFS_SAMPLES_PATH )
|
||||||
set( ECCODES_IFS_SAMPLES_PATH ${grib_api_default_data_prefix}/share/eccodes/ifs_samples )
|
set( ECCODES_IFS_SAMPLES_PATH ${the_default_data_prefix}/${ECCODES_IFS_SAMPLES_SUFF} )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
### config header
|
### config header
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
if( @PNAME@_IS_BUILD_DIR_EXPORT )
|
||||||
|
set( ECCODES_DEFINITION_PATH @CMAKE_BINARY_DIR@/@ECCODES_DEFINITION_SUFF@ )
|
||||||
|
set( ECCODES_SAMPLES_PATH @CMAKE_BINARY_DIR@/@ECCODES_SAMPLES_SUFF@ )
|
||||||
|
set( ECCODES_IFS_SAMPLES_PATH @CMAKE_BINARY_DIR@/@ECCODES_IFS_SAMPLES_SUFF@ )
|
||||||
|
else()
|
||||||
|
set( ECCODES_DEFINITION_PATH @CMAKE_INSTALL_PREFIX@/@ECCODES_DEFINITION_SUFF@ )
|
||||||
|
set( ECCODES_SAMPLES_PATH @CMAKE_INSTALL_PREFIX@/@ECCODES_SAMPLES_SUFF@ )
|
||||||
|
set( ECCODES_IFS_SAMPLES_PATH @CMAKE_INSTALL_PREFIX@/@ECCODES_IFS_SAMPLES_SUFF@ )
|
||||||
|
endif()
|
|
@ -1,3 +0,0 @@
|
||||||
set( ECCODES_SAMPLES_PATH "@ECCODES_SAMPLES_PATH@" )
|
|
||||||
set( ECCODES_IFS_SAMPLES_PATH "@ECCODES_IFS_SAMPLES_PATH@" )
|
|
||||||
set( ECCODES_DEFINITION_PATH "@ECCODES_DEFINITION_PATH@" )
|
|
Loading…
Reference in New Issue