forked from Andersbakken/rtags
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EnsureLibrariesRunner.cmake
28 lines (20 loc) · 1.01 KB
/
EnsureLibrariesRunner.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
IF ( NOT EXISTS ${LIBRARY} )
MESSAGE ( FATAL_ERROR "The provided file ${LIBRARY} does not exist" )
RETURN ()
ENDIF ( NOT EXISTS ${LIBRARY} )
SET ( TARGET_PATH "${TARGET}" )
IF ( EXISTS ${TARGET} AND NOT IS_DIRECTORY ${TARGET} )
FILE ( TO_NATIVE_PATH "${TARGET}" TARGET_PATH )
IF ( EXISTS ${TARGET_PATH} )
GET_FILENAME_COMPONENT ( TARGET_PATH ${TARGET} PATH )
ENDIF ( EXISTS ${TARGET_PATH} )
ENDIF ( EXISTS ${TARGET} AND NOT IS_DIRECTORY ${TARGET} )
IF ( NOT EXISTS ${TARGET_PATH} AND NOT IS_DIRECTORY ${TARGET_PATH} )
MESSAGE ( FATAL_ERROR "The provided target ${TARGET_PATH} does not exist, and is not a directory" )
RETURN ()
ENDIF ( NOT EXISTS ${TARGET_PATH} AND NOT IS_DIRECTORY ${TARGET_PATH} )
SET ( OUTPUT_TARGET ${TARGET_PATH} )
FILE ( TO_NATIVE_PATH "${LIBRARY}" NATIVE_LIBRARY_PATH )
FILE ( TO_NATIVE_PATH "${OUTPUT_TARGET}/" NATIVE_TARGET_PATH )
#MESSAGE ( STATUS "Copying ${NATIVE_LIBRARY_PATH} => ${NATIVE_TARGET_PATH}" )
FILE ( COPY ${NATIVE_LIBRARY_PATH} DESTINATION ${NATIVE_TARGET_PATH} )