File: CopyFileHelper.cmake

package info (click to toggle)
warzone2100 4.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 660,348 kB
  • sloc: cpp: 675,711; ansic: 387,204; javascript: 75,107; python: 16,628; php: 4,294; sh: 3,941; makefile: 2,330; lisp: 1,492; cs: 489; xml: 404; perl: 224; ruby: 156; java: 89
file content (26 lines) | stat: -rw-r--r-- 723 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
cmake_minimum_required(VERSION 3.16...3.31)

# Required input defines:
# - INPUT_FILE: the path to the input file
# - OUTPUT_FILE: the full filename + path for the output file
#
# Optional input defines:
# - SKIP_IF_OUTPUT_EXISTS: ON or OFF (default)
# - SKIP_IF_INPUT_MISSING: ON or OFF (default)
#

if(NOT EXISTS "${INPUT_FILE}")
	if(NOT SKIP_IF_INPUT_MISSING)
		message( FATAL_ERROR "Input file does not exist at: \"${INPUT_FILE}\"" )
	endif()
	return()
endif()

if(SKIP_IF_OUTPUT_EXISTS AND EXISTS "${OUTPUT_FILE}")
	message( STATUS "Skipping copy; output file already exists at: \"${OUTPUT_FILE}\"" )
	return()
endif()

# Copy source file to destination path
configure_file("${INPUT_FILE}" "${OUTPUT_FILE}" COPYONLY)