File: CMakeLists.txt

package info (click to toggle)
eccodes 2.46.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 154,956 kB
  • sloc: cpp: 163,970; ansic: 26,310; sh: 22,006; f90: 6,854; perl: 6,361; python: 5,352; java: 2,226; javascript: 1,427; yacc: 854; fortran: 543; lex: 359; makefile: 279; xml: 183; awk: 66
file content (63 lines) | stat: -rw-r--r-- 2,331 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
file( GLOB definition_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.def" )

set(definition_files ${definition_files} PARENT_SCOPE) # needed for memfs

file( GLOB table_files      RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.table" )
file( GLOB text_files       RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.txt" )

# 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} )
      set( add_child 1 )
      if( NOT HAVE_PRODUCT_BUFR AND child STREQUAL bufr )
        set( add_child 0 )
      endif()
      if( NOT HAVE_PRODUCT_GRIB AND child MATCHES "^grib" )
        set( add_child 0 )
      endif()
      if( add_child )
        list( APPEND dirlist ${child} )
      endif()
  endif()
endforeach()

if( HAVE_INSTALL_ECCODES_DEFINITIONS )
  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
           DESTINATION ${ECCODES_DEFINITION_SUFF} )

  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 )
endif()

# link to the definitions. See GRIB-786
file( MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${INSTALL_DATA_DIR} )
if( NOT EXISTS "${CMAKE_BINARY_DIR}/${ECCODES_DEFINITION_SUFF}" )
  execute_process( COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink"
    "${CMAKE_CURRENT_SOURCE_DIR}"
    "${CMAKE_BINARY_DIR}/${ECCODES_DEFINITION_SUFF}" )
endif()

# copy the definitions to the build directory
#file(    COPY ${definition_files} ${table_files} ${text_files}
#         DESTINATION ${CMAKE_BINARY_DIR}/${ECCODES_DEFINITION_SUFF} )
#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 )