GRIB-681: CMake Exports for IFS Samples Path

This commit is contained in:
Shahram Najm 2015-01-19 10:23:02 +00:00
parent 3ad092ba09
commit 8b0c048f41
6 changed files with 30 additions and 4 deletions

View File

@ -181,6 +181,9 @@ endif()
if( NOT DEFINED GRIB_API_SAMPLES_PATH )
set( GRIB_API_SAMPLES_PATH ${grib_api_default_data_prefix}/share/grib_api/samples )
endif()
if( NOT DEFINED GRIB_API_IFS_SAMPLES_PATH )
set( GRIB_API_IFS_SAMPLES_PATH ${grib_api_default_data_prefix}/share/grib_api/ifs_samples )
endif()
### config header
@ -250,11 +253,19 @@ add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
# temporary -- add support for ecbuild 1.0.x sub-project inclusion
# to remove once mars server & client use eckit & ecbuild >= 1.1
if( EC_HAVE_FORTRAN )
list( APPEND GRIB_API_INCLUDE_DIRS ${CMAKE_Fortran_MODULE_DIRECTORY} )
list( APPEND GRIB_API_LIBRARIES grib_api_f77 grib_api_f90 )
endif()
if( NOT ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
set( GRIB_API_DEFINITIONS ${GRIB_API_DEFINITIONS} PARENT_SCOPE )# includes already TPL definitions
set( GRIB_API_INCLUDE_DIRS ${GRIB_API_INCLUDE_DIRS} ${GRIB_API_EXTRA_INCLUDE_DIRS} PARENT_SCOPE )
set( GRIB_API_LIBRARIES ${GRIB_API_LIBRARIES} ${GRIB_API_EXTRA_LIBRARIES} ${CMATH_LIBRARIES} PARENT_SCOPE )
set( GRIB_API_FOUND TRUE PARENT_SCOPE )
set( GRIB_API_SAMPLES_PATH ${GRIB_API_SAMPLES_PATH} PARENT_SCOPE )
set( GRIB_API_IFS_SAMPLES_PATH ${GRIB_API_IFS_SAMPLES_PATH} PARENT_SCOPE )
set( GRIB_API_DEFINITION_PATH ${GRIB_API_DEFINITION_PATH} PARENT_SCOPE )
endif()
############################################################################################

3
grib_api-import.cmake.in Normal file
View File

@ -0,0 +1,3 @@
set( GRIB_API_SAMPLES_PATH "@GRIB_API_SAMPLES_PATH@" )
set( GRIB_API_IFS_SAMPLES_PATH "@GRIB_API_IFS_SAMPLES_PATH@" )
set( GRIB_API_DEFINITION_PATH "@GRIB_API_DEFINITION_PATH@" )

View File

@ -8,5 +8,8 @@ list( APPEND ifs_samples_${_basedir}
)
install( FILES ${GRIB_API_SAMPLES_FILES} ${ifs_samples_${_basedir}}
DESTINATION share/${PROJECT_NAME}/ifs_samples/${_basedir}
DESTINATION ${GRIB_API_IFS_SAMPLES_PATH}/${_basedir}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
file( COPY ${ifs_samples_${_basedir}}
DESTINATION ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/ifs_samples/${_basedir} )

View File

@ -8,5 +8,8 @@ list( APPEND ifs_samples_${_basedir}
)
install( FILES ${GRIB_API_SAMPLES_FILES} ${ifs_samples_${_basedir}}
DESTINATION share/${PROJECT_NAME}/ifs_samples/${_basedir}
DESTINATION ${GRIB_API_IFS_SAMPLES_PATH}/${_basedir}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
file( COPY ${ifs_samples_${_basedir}}
DESTINATION ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/ifs_samples/${_basedir} )

View File

@ -8,5 +8,8 @@ list( APPEND ifs_samples_${_basedir}
)
install( FILES ${GRIB_API_SAMPLES_FILES} ${ifs_samples_${_basedir}}
DESTINATION share/${PROJECT_NAME}/ifs_samples/${_basedir}
DESTINATION ${GRIB_API_IFS_SAMPLES_PATH}/${_basedir}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
file( COPY ${ifs_samples_${_basedir}}
DESTINATION ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/ifs_samples/${_basedir} )

View File

@ -8,5 +8,8 @@ list( APPEND ifs_samples_${_basedir}
)
install( FILES ${GRIB_API_SAMPLES_FILES} ${ifs_samples_${_basedir}}
DESTINATION share/${PROJECT_NAME}/ifs_samples/${_basedir}
DESTINATION ${GRIB_API_IFS_SAMPLES_PATH}/${_basedir}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
file( COPY ${ifs_samples_${_basedir}}
DESTINATION ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/ifs_samples/${_basedir} )