forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopyPattern.cmake
More file actions
27 lines (25 loc) · 897 Bytes
/
CopyPattern.cmake
File metadata and controls
27 lines (25 loc) · 897 Bytes
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
# Filename: CopyPattern.cmake
#
# Description: This is a standalone version of CMake's file(COPY) command so we
# can use all of its features during build-time instead of
# config-time.
#
# Usage:
# This script is invoked via add_custom_target, like this:
# cmake -D SOURCE=[source directory]
# -D DESTINATION=[destination directory]
# -D FILES_MATCHING="[globbing patterns passed to file(COPY)]"
# -P CopyPattern.cmake
if(NOT DEFINED SOURCE OR NOT DEFINED DESTINATION)
message(SEND_ERROR "CopyPattern.cmake requires SOURCE and DESTINATION to be
defined.")
endif()
if(DEFINED FILES_MATCHING)
separate_arguments(FILES_MATCHING UNIX_COMMAND ${FILES_MATCHING})
file(COPY "${SOURCE}"
DESTINATION "${DESTINATION}"
FILES_MATCHING ${FILES_MATCHING})
else()
file(COPY "${SOURCE}"
DESTINATION "${DESTINATION}")
endif()