VirtualBox

source: vbox/trunk/src/libs/libpng-1.6.36/scripts/genchk.cmake.in@ 81624

Last change on this file since 81624 was 76030, checked in by vboxsync, 6 years ago

libpng-1.6.36: properly export to OSE, and while at it fix EOL style for shell scripts

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1# genchk.cmake.in
2# Generate .chk from .out with awk (generic), based upon the automake logic.
3
4# Copyright (C) 2016 Glenn Randers-Pehrson
5# Written by Roger Leigh, 2016
6
7# This code is released under the libpng license.
8# For conditions of distribution and use, see the disclaimer
9# and license in png.h
10
11# Variables substituted from CMakeLists.txt
12set(SRCDIR "@CMAKE_CURRENT_SOURCE_DIR@")
13
14set(AWK "@AWK@")
15
16get_filename_component(INPUTEXT "${INPUT}" EXT)
17get_filename_component(OUTPUTEXT "${OUTPUT}" EXT)
18get_filename_component(INPUTBASE "${INPUT}" NAME_WE)
19get_filename_component(OUTPUTBASE "${OUTPUT}" NAME_WE)
20get_filename_component(INPUTDIR "${INPUT}" PATH)
21get_filename_component(OUTPUTDIR "${OUTPUT}" PATH)
22
23if("${INPUTEXT}" STREQUAL ".out" AND "${OUTPUTEXT}" STREQUAL ".chk")
24 # Generate .chk from .out with awk (generic)
25 file(REMOVE "${OUTPUT}" "${OUTPUTDIR}/${OUTPUTBASE}.new")
26 execute_process(COMMAND "${AWK}" -f "${SRCDIR}/scripts/checksym.awk"
27 "${SRCDIR}/scripts/${INPUTBASE}.def"
28 "of=${OUTPUTDIR}/${OUTPUTBASE}.new"
29 "${INPUT}"
30 RESULT_VARIABLE AWK_FAIL)
31 if(AWK_FAIL)
32 message(FATAL_ERROR "Failed to generate ${OUTPUTDIR}/${OUTPUTBASE}.new")
33 endif()
34 file(RENAME "${OUTPUTDIR}/${OUTPUTBASE}.new" "${OUTPUT}")
35else()
36 message(FATAL_ERROR "Unsupported conversion: ${INPUTEXT} to ${OUTPUTEXT}")
37endif()
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette