-
Notifications
You must be signed in to change notification settings - Fork 0
/
copy-existing-otrs.cmake
29 lines (26 loc) · 1.21 KB
/
copy-existing-otrs.cmake
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
message(STATUS "Copying otr files...")
if(NOT ONLY2SHIPOTR AND EXISTS ${SOURCE_DIR}/OTRExporter/mm.zip)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy mm.zip ${SOURCE_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy mm.zip ${BINARY_DIR}/mm/)
message(STATUS "Copied mm.zip")
endif()
if(EXISTS ${SOURCE_DIR}/OTRExporter/2ship.zip)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy 2ship.zip ${SOURCE_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy 2ship.zip ${BINARY_DIR}/mm/)
message(STATUS "Copied 2ship.zip")
endif()
# Additionally for Windows, copy the otrs to the target dir, side by side with 2ship.exe
if(SYSTEM_NAME MATCHES "Windows")
if(NOT ONLY2SHIPOTR AND EXISTS ${SOURCE_DIR}/OTRExporter/mm.zip)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy mm.zip ${TARGET_DIR})
endif()
if(EXISTS ${SOURCE_DIR}/OTRExporter/2ship.zip)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy 2ship.zip ${TARGET_DIR})
endif()
endif()
if(NOT ONLY2SHIPOTR AND (NOT EXISTS ${SOURCE_DIR}/mm.zip))
message(FATAL_ERROR "Failed to copy. No ZIP files found.")
endif()
if(NOT EXISTS ${SOURCE_DIR}/2ship.zip)
message(FATAL_ERROR "Failed to copy. No 2ship ZIP found.")
endif()