File: CMakeLists.txt

package info (click to toggle)
eccodes 2.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 480,184 kB
  • sloc: ansic: 163,815; makefile: 21,266; sh: 8,507; python: 6,026; f90: 5,762; perl: 2,891; yacc: 818; lex: 356; cpp: 305; fortran: 116; awk: 66
file content (35 lines) | stat: -rw-r--r-- 1,261 bytes parent folder | download
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
add_custom_command(
  OUTPUT  ${CMAKE_CURRENT_BINARY_DIR}/memfs.c
  COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/memfs.py
    ${PROJECT_SOURCE_DIR}/definitions
    ${PROJECT_SOURCE_DIR}/samples
    ${PROJECT_SOURCE_DIR}/ifs_samples
    ${CMAKE_CURRENT_BINARY_DIR}/memfs.c
  DEPENDS ${PROJECT_SOURCE_DIR}/memfs.py )

set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/memfs.c 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   ${CMAKE_CURRENT_BINARY_DIR}/memfs.c
    GENERATED ${CMAKE_CURRENT_BINARY_DIR}/memfs.c)

    ecbuild_add_library(TARGET    eccodes_memfs_static
      VERSION   0
      TYPE      STATIC
      CFLAGS    ${CFLAGS}
      SOURCES   ${CMAKE_CURRENT_BINARY_DIR}/memfs.c
      GENERATED ${CMAKE_CURRENT_BINARY_DIR}/memfs.c)

endif()