2013-04-02 14:17:46 +00:00
|
|
|
file( GLOB definition_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.def" )
|
2016-06-14 14:27:49 +00:00
|
|
|
|
|
|
|
set(definition_files ${definition_files} PARENT_SCOPE) # needed for memfs
|
|
|
|
|
2015-04-10 12:39:03 +00:00
|
|
|
file( GLOB table_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.table" )
|
|
|
|
file( GLOB text_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.txt" )
|
2013-04-02 14:17:46 +00:00
|
|
|
|
2020-01-15 12:33:15 +00:00
|
|
|
# Collect all directories at the top-level of definitions
|
|
|
|
file( GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*" )
|
|
|
|
set( dirlist "" )
|
|
|
|
foreach( child ${children} )
|
|
|
|
if( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${child} )
|
2020-03-12 14:16:45 +00:00
|
|
|
set( add_child 1 )
|
|
|
|
if( NOT HAVE_PRODUCT_BUFR AND child STREQUAL bufr )
|
|
|
|
set( add_child 0 )
|
|
|
|
endif()
|
2020-03-12 17:19:34 +00:00
|
|
|
if( NOT HAVE_PRODUCT_GRIB AND child MATCHES "^grib" )
|
|
|
|
set( add_child 0 )
|
|
|
|
endif()
|
2020-03-12 14:16:45 +00:00
|
|
|
if( add_child )
|
|
|
|
list( APPEND dirlist ${child} )
|
|
|
|
endif()
|
2020-01-15 12:33:15 +00:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
2020-03-26 14:21:56 +00:00
|
|
|
if( HAVE_INSTALL_ECCODES_DEFINITIONS )
|
2017-07-19 16:14:07 +00:00
|
|
|
install( FILES ${definition_files} ${table_files} ${text_files}
|
|
|
|
DESTINATION ${ECCODES_DEFINITION_SUFF}
|
|
|
|
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
|
|
|
|
|
|
|
|
install( FILES installDefinitions.sh
|
2020-03-26 14:21:56 +00:00
|
|
|
DESTINATION ${ECCODES_DEFINITION_SUFF} )
|
2017-07-19 16:14:07 +00:00
|
|
|
|
2020-03-26 14:21:56 +00:00
|
|
|
install( DIRECTORY ${dirlist}
|
|
|
|
DESTINATION ${ECCODES_DEFINITION_SUFF}
|
|
|
|
FILES_MATCHING
|
|
|
|
PATTERN "*.def"
|
|
|
|
PATTERN "*.txt"
|
|
|
|
PATTERN "*.list"
|
|
|
|
PATTERN "*.table"
|
|
|
|
PATTERN "4.2.192.*.table" EXCLUDE
|
|
|
|
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
|
2017-07-19 16:14:07 +00:00
|
|
|
endif()
|
2014-01-31 11:42:05 +00:00
|
|
|
|
2015-07-02 12:02:54 +00:00
|
|
|
# link to the definitions. See GRIB-786
|
2017-02-03 13:46:04 +00:00
|
|
|
file( MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${INSTALL_DATA_DIR} )
|
|
|
|
if( NOT EXISTS "${CMAKE_BINARY_DIR}/${ECCODES_DEFINITION_SUFF}" )
|
2015-07-23 15:17:50 +00:00
|
|
|
execute_process( COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
2017-02-03 13:46:04 +00:00
|
|
|
"${CMAKE_BINARY_DIR}/${ECCODES_DEFINITION_SUFF}" )
|
2015-07-23 15:17:50 +00:00
|
|
|
endif()
|
2015-07-02 12:02:54 +00:00
|
|
|
|
2014-01-31 11:42:05 +00:00
|
|
|
# copy the definitions to the build directory
|
2015-06-30 16:18:51 +00:00
|
|
|
#file( COPY ${definition_files} ${table_files} ${text_files}
|
2017-02-03 13:46:04 +00:00
|
|
|
# DESTINATION ${CMAKE_BINARY_DIR}/${ECCODES_DEFINITION_SUFF} )
|
2020-03-26 14:21:56 +00:00
|
|
|
#file(COPY budg bufr cdf common grib1 grib2 grib3 gts mars metar tide hdf5 wrap
|
|
|
|
# DESTINATION ${CMAKE_BINARY_DIR}/${ECCODES_DEFINITION_SUFF}
|
|
|
|
# FILES_MATCHING
|
|
|
|
# PATTERN "*.def"
|
|
|
|
# PATTERN "*.txt"
|
|
|
|
# PATTERN "*.list"
|
|
|
|
# PATTERN "*.table"
|
|
|
|
# PATTERN "4.2.192.*.table" EXCLUDE )
|