File: CMakeLists.txt

package info (click to toggle)
eccodes 2.21.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 402,752 kB
  • sloc: ansic: 193,646; makefile: 21,361; sh: 11,109; f90: 5,962; python: 4,833; perl: 3,272; javascript: 1,427; yacc: 818; lex: 356; awk: 66
file content (64 lines) | stat: -rw-r--r-- 2,338 bytes parent folder | download | duplicates (3)
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
64
set( generated_c_files
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_000.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_001.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_002.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_003.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_004.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_005.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_006.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_final.c)

set( exclude "" )
if( NOT HAVE_PRODUCT_BUFR )
  set( exclude -exclude bufr )
  set( generated_c_files
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_000.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_001.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_002.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_003.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_004.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_final.c)
elseif( NOT HAVE_PRODUCT_GRIB )
  set( exclude -exclude grib )
  set( generated_c_files
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_000.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_001.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_002.c
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_final.c)
endif()

add_custom_command(
  OUTPUT ${generated_c_files}
  COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/memfs.py
    ${exclude}
    ${PROJECT_SOURCE_DIR}/definitions
    ${PROJECT_SOURCE_DIR}/samples
    ${PROJECT_SOURCE_DIR}/ifs_samples
    ${CMAKE_CURRENT_BINARY_DIR}/memfs_gen
  DEPENDS ${PROJECT_SOURCE_DIR}/memfs.py)

set_source_files_properties(
    ${generated_c_files} PROPERTIES OBJECT_DEPENDS
    "${PROJECT_SOURCE_DIR}/memfs.py"
    # "${PROJECT_SOURCE_DIR}/memfs.py" ${definition_files}"
    )

# No debug symbols on Cray (workaround for HPC-230)
if( CMAKE_C_COMPILER_ID MATCHES Cray )
  string( REGEX REPLACE "-g|-G[ 0-3]" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" )
  string( REGEX REPLACE "-g|-G[ 0-3]" " " CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_CAPS} "${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_CAPS}}" )
endif()

if( HAVE_MEMFS )
  ecbuild_add_library(TARGET    eccodes_memfs
    VERSION 0
    CFLAGS ${CFLAGS}
                        SOURCES   ${generated_c_files}
                        GENERATED ${generated_c_files})
  ecbuild_add_library(TARGET    eccodes_memfs_static
    VERSION 0
    CFLAGS ${CFLAGS}
    TYPE STATIC
                        SOURCES   ${generated_c_files}
                        GENERATED ${generated_c_files})
endif()