File: CMakeLists.txt

package info (click to toggle)
odc 1.6.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,144 kB
  • sloc: cpp: 21,984; f90: 3,707; sh: 966; ansic: 477; python: 389; makefile: 33
file content (60 lines) | stat: -rw-r--r-- 1,532 bytes parent folder | download | duplicates (2)
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

list( APPEND _api_fodc_tests
    general
    read
    encode
)

foreach( _test ${_api_fodc_tests} )
    ecbuild_add_test(
        TARGET       odc_fapi_${_test}
        SOURCES      ${_test}.f90
        ENVIRONMENT  ${test_environment}
        TEST_DEPENDS odc_get_test_data
        CONDITION    HAVE_FORTRAN
        LINKER_LANGUAGE Fortran
        LIBS         fodc )
endforeach()

list( APPEND _api_fodc_example_sources
    odc_header
    odc_encode_custom
    odc_encode_row_major
    odc_ls
)

list( APPEND _api_fodc_example_targets
    odc-fortran-header
    odc-fortran-encode-custom
    odc-fortran-encode-row-major
    odc-fortran-ls
)

list( LENGTH _api_fodc_example_sources _count )
math( EXPR _count "${_count}-1" )

foreach( _i RANGE ${_count} )
    list( GET _api_fodc_example_sources ${_i} _sources )
    list( GET _api_fodc_example_targets ${_i} _target )

    ecbuild_add_executable( TARGET     ${_target}
                            SOURCES    ${_sources}.f90
                            LIBS       fodc
                            CONDITION  HAVE_FORTRAN
                            LINKER_LANGUAGE Fortran
                            NOINSTALL )
endforeach()

list( APPEND _fapi_odc_tests_scripts
    usage_examples.sh
)

foreach( _script ${_fapi_odc_tests_scripts} )
    ecbuild_add_test(
        TARGET odc_fapi_${_script}
        TYPE script
        COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${_script}
        ENVIRONMENT PATH=${CMAKE_BINARY_DIR}/bin:$ENV{PATH}
        CONDITION   HAVE_FORTRAN
    )
endforeach()