-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathext_cmake_install.cmake
More file actions
43 lines (38 loc) · 1.05 KB
/
ext_cmake_install.cmake
File metadata and controls
43 lines (38 loc) · 1.05 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
macro(ext_install lib)
ext_log("prepare install for: ${lib}")
install(
TARGETS "${lib}"
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
foreach(arg ${ARGN})
install(
DIRECTORY "${arg}"
DESTINATION include
)
endforeach()
#include(CPack)
endmacro(ext_install)
function(ext_install_files from_dir to_dir files)
foreach (file ${files})
get_filename_component(parent ${file} DIRECTORY)
if(IS_DIRECTORY ${from_dir}/${file})
ext_log("install dir ${from_dir}/${file} to ${to_dir}/${parent}")
install(
DIRECTORY
${from_dir}/${file}
DESTINATION
${to_dir}/${parent}
)
else()
ext_log("install file ${from_dir}/${file} to ${to_dir}/${parent}")
install(
FILES
${from_dir}/${file}
DESTINATION
${to_dir}/${parent}
)
endif()
endforeach()
endfunction(ext_install_files)