Diff of /FindGnuTar.cmake [a32c83] .. [c967f8]  Maximize  Restore

Switch to unified view

a/FindGnuTar.cmake b/FindGnuTar.cmake
...
...
24
#  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
#  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
#
25
#
26
# Try to find the gnu tar command
26
# Try to find the gnu tar command
27
# Once done this will define
27
# Once done this will define
28
#
28
#
29
#       GnuTar_FOUND
29
#       GNUTAR_FOUND
30
#       GnuTar_EXECUTABLE
30
#       GNUTAR_EXECUTABLE
31
#
31
#
32
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
32
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
33
33
34
set(GnuTar_FOUND false)
35
find_program(GnuTar_EXECUTABLE NAMES "gtar" "tar")
34
find_program(GNUTAR_EXECUTABLE NAMES "gtar" "tar")
36
mark_as_advanced(GnuTar_EXECUTABLE)
35
mark_as_advanced(GNUTAR_EXECUTABLE)
37
36
38
if(GnuTar_EXECUTABLE)
37
if(GNUTAR_EXECUTABLE)
39
  execute_process(COMMAND ${GnuTar_EXECUTABLE} --version
38
  execute_process(COMMAND ${GNUTAR_EXECUTABLE} --version
40
    OUTPUT_VARIABLE GnuTar_output
39
    OUTPUT_VARIABLE GNUTAR_output
41
    ERROR_VARIABLE GnuTar_error
40
    ERROR_VARIABLE GNUTAR_error
42
    RESULT_VARIABLE GnuTar_result
41
    RESULT_VARIABLE GNUTAR_result
43
    OUTPUT_STRIP_TRAILING_WHITESPACE)
42
    OUTPUT_STRIP_TRAILING_WHITESPACE)
44
  if(${GnuTar_result} EQUAL 0)
43
  if(${GNUTAR_result} EQUAL 0)
45
    string(REGEX REPLACE "[\n]+" ";" GnuTar_version ${GnuTar_output})
44
    string(REGEX REPLACE "[\n]+" ";" GNUTAR_version ${GNUTAR_output})
46
    foreach(_l ${GnuTar_version})
45
    foreach(_l ${GNUTAR_version})
47
      if(_l MATCHES "^tar +\\(GNU +tar\\) +[0-9]")
46
      if(_l MATCHES "^tar +\\(GNU +tar\\) +[0-9]")
48
        string(REGEX REPLACE "^tar +\\(GNU +tar\\) +([0-9]\\.[0-9]+)" "\\1" GnuTar_VERSION_STRING ${_l})
47
        string(REGEX REPLACE "^tar +\\(GNU +tar\\) +([0-9]\\.[0-9]+)" "\\1" GNUTAR_VERSION_STRING ${_l})
49
        set(GnuTar_FOUND true)
50
        break()
48
        break()
51
      endif()
49
      endif()
52
    endforeach()
50
    endforeach()
53
  endif()
51
  endif()
54
endif()
52
endif()
53
54
# handle the QUIETLY and REQUIRED arguments and set GNUTAR_FOUND to TRUE if
55
# all listed variables are TRUE
55
include(FindPackageHandleStandardArgs)
56
include(FindPackageHandleStandardArgs)
56
find_package_handle_standard_args(GnuTar
57
find_package_handle_standard_args(GNUTAR DEFAULT_MSG GNUTAR_EXECUTABLE GNUTAR_VERSION_STRING)
57
                                  VERSION_VAR GnuTar_VERSION_STRING)
58
include(CMakeParseArguments)
58
include(CMakeParseArguments)
59
59

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks