GRIB-822: Make definitions/samples suffixes overridable, but not paths, Place ifs_samples in build and install root by default

This commit is contained in:
Shahram Najm 2015-09-22 11:42:54 +01:00
parent 0f19e16641
commit 76530a0cbf
4 changed files with 26 additions and 26 deletions

View File

@ -194,19 +194,19 @@ else()
set( the_default_data_prefix ${CMAKE_BINARY_DIR} ) set( the_default_data_prefix ${CMAKE_BINARY_DIR} )
endif() endif()
if( NOT DEFINED ECCODES_DEFINITION_SUFF )
set( ECCODES_DEFINITION_SUFF share/eccodes/definitions ) set( ECCODES_DEFINITION_SUFF share/eccodes/definitions )
endif()
if( NOT DEFINED ECCODES_SAMPLES_SUFF )
set( ECCODES_SAMPLES_SUFF share/eccodes/samples ) set( ECCODES_SAMPLES_SUFF share/eccodes/samples )
set( ECCODES_IFS_SAMPLES_SUFF share/eccodes/ifs_samples ) endif()
if( NOT DEFINED ECCODES_IFS_SAMPLES_SUFF )
set( ECCODES_IFS_SAMPLES_SUFF ifs_samples )
endif()
if( NOT DEFINED ECCODES_DEFINITION_PATH )
set( ECCODES_DEFINITION_PATH ${the_default_data_prefix}/${ECCODES_DEFINITION_SUFF} ) set( ECCODES_DEFINITION_PATH ${the_default_data_prefix}/${ECCODES_DEFINITION_SUFF} )
endif()
if( NOT DEFINED ECCODES_SAMPLES_PATH )
set( ECCODES_SAMPLES_PATH ${the_default_data_prefix}/${ECCODES_SAMPLES_SUFF} ) set( ECCODES_SAMPLES_PATH ${the_default_data_prefix}/${ECCODES_SAMPLES_SUFF} )
endif()
if( NOT DEFINED ECCODES_IFS_SAMPLES_PATH )
set( ECCODES_IFS_SAMPLES_PATH ${the_default_data_prefix}/${ECCODES_IFS_SAMPLES_SUFF} ) set( ECCODES_IFS_SAMPLES_PATH ${the_default_data_prefix}/${ECCODES_IFS_SAMPLES_SUFF} )
endif()
### config header ### config header
@ -282,10 +282,10 @@ if( EC_HAVE_FORTRAN )
endif() endif()
if( NOT PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME ) if( NOT PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
set( ECCODES_FOUND TRUE PARENT_SCOPE )
set( ECCODES_DEFINITIONS ${ECCODES_DEFINITIONS} PARENT_SCOPE )# includes already TPL definitions set( ECCODES_DEFINITIONS ${ECCODES_DEFINITIONS} PARENT_SCOPE )# includes already TPL definitions
set( ECCODES_INCLUDE_DIRS ${ECCODES_INCLUDE_DIRS} ${ECCODES_EXTRA_INCLUDE_DIRS} PARENT_SCOPE ) set( ECCODES_INCLUDE_DIRS ${ECCODES_INCLUDE_DIRS} ${ECCODES_EXTRA_INCLUDE_DIRS} PARENT_SCOPE )
set( ECCODES_LIBRARIES ${ECCODES_LIBRARIES} ${ECCODES_EXTRA_LIBRARIES} ${CMATH_LIBRARIES} PARENT_SCOPE ) set( ECCODES_LIBRARIES ${ECCODES_LIBRARIES} ${ECCODES_EXTRA_LIBRARIES} ${CMATH_LIBRARIES} PARENT_SCOPE )
set( ECCODES_FOUND TRUE PARENT_SCOPE )
set( ECCODES_SAMPLES_PATH ${ECCODES_SAMPLES_PATH} PARENT_SCOPE ) set( ECCODES_SAMPLES_PATH ${ECCODES_SAMPLES_PATH} PARENT_SCOPE )
set( ECCODES_IFS_SAMPLES_PATH ${ECCODES_IFS_SAMPLES_PATH} PARENT_SCOPE ) set( ECCODES_IFS_SAMPLES_PATH ${ECCODES_IFS_SAMPLES_PATH} PARENT_SCOPE )
set( ECCODES_DEFINITION_PATH ${ECCODES_DEFINITION_PATH} PARENT_SCOPE ) set( ECCODES_DEFINITION_PATH ${ECCODES_DEFINITION_PATH} PARENT_SCOPE )

View File

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

View File

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

View File

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