eccodes/samples/CMakeLists.txt

23 lines
885 B
CMake
Raw Permalink Normal View History

2013-04-03 10:45:13 +00:00
file( GLOB samples_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.tmpl" )
if(HAVE_INSTALL_ECCODES_SAMPLES)
install( FILES ${samples_files}
DESTINATION ${ECCODES_SAMPLES_SUFF}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
endif()
2013-04-03 10:45:13 +00:00
foreach( tmpl ${samples_files} )
2015-02-18 18:11:38 +00:00
list( APPEND ECCODES_SAMPLES_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${tmpl} )
endforeach()
2013-04-03 10:45:13 +00:00
2015-02-18 18:11:38 +00:00
set( ECCODES_SAMPLES_DIR ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE )
set( ECCODES_SAMPLES_FILES ${ECCODES_SAMPLES_FILES} PARENT_SCOPE )
2015-07-02 12:02:54 +00:00
# link to the samples in the build directory. See GRIB-786
file( MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${INSTALL_DATA_DIR} )
if( NOT EXISTS "${CMAKE_BINARY_DIR}/${ECCODES_SAMPLES_SUFF}" )
execute_process( COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink"
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_BINARY_DIR}/${ECCODES_SAMPLES_SUFF}" )
endif()