File: Proj4Test.cmake

package info (click to toggle)
proj 4.9.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 58,684 kB
  • ctags: 3,263
  • sloc: sh: 885,752; ansic: 26,077; makefile: 235; java: 60; xml: 46
file content (32 lines) | stat: -rw-r--r-- 876 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
#
# add test with sh script
#

function(proj_add_test_script_sh SH_NAME BIN_USE)
  if(UNIX)
    get_filename_component(testname ${SH_NAME} NAME_WE)
    
    set(TEST_OK 1)
    if(ARGV2)
         set(TEST_OK 0)
         set(GRID_FULLNAME ${PROJECT_SOURCE_DIR}/nad/${ARGV2})
         if(EXISTS ${GRID_FULLNAME})
            set(TEST_OK 1)
         endif(EXISTS ${GRID_FULLNAME})
    endif(ARGV2)
    
    if( CMAKE_VERSION VERSION_LESS 2.8.4 )
       set(TEST_OK 0)
       message(STATUS "test with bash script need a cmake version >= 2.8.4")
    endif()
 
    if(${TEST_OK})
      add_test( NAME "${testname}"
                WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/nad
                COMMAND  ${PROJECT_SOURCE_DIR}/nad/${SH_NAME} 
                         ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${${BIN_USE}} 
               )
    endif(${TEST_OK})
    
  endif(UNIX)
endfunction()