blob: e0d73d5fc34ab90a1b770d8b9c8903b2ac0a130b (
plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
set(opentrack-perms_ WORLD_READ WORLD_EXECUTE OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)
set(opentrack-perms PERMISSIONS ${opentrack-perms_})
macro(otr_inst2 path)
install(${ARGN} DESTINATION "${path}" ${opentrack-perms})
endmacro()
macro(otr_inst_dir path)
install(
DIRECTORY ${ARGN} DESTINATION "${path}"
FILE_PERMISSIONS ${opentrack-perms_}
DIRECTORY_PERMISSIONS ${opentrack-perms_}
)
endmacro()
function(install_sources)
get_property(source-dirs GLOBAL PROPERTY opentrack-all-source-dirs)
foreach(k ${source-dirs})
file(RELATIVE_PATH dest "${CMAKE_SOURCE_DIR}" "${k}")
otr_inst_dir("${opentrack-doc-src-pfx}" "${dest}")
endforeach()
endfunction()
otr_inst_dir("${opentrack-doc-pfx}" ${CMAKE_SOURCE_DIR}/3rdparty-notices)
otr_inst_dir("${opentrack-doc-pfx}" "${CMAKE_SOURCE_DIR}/settings" "${CMAKE_SOURCE_DIR}/contrib")
otr_inst_dir("${opentrack-doc-src-pfx}" "${CMAKE_SOURCE_DIR}/cmake")
otr_inst_dir("${opentrack-doc-src-pfx}" "${CMAKE_SOURCE_DIR}/bin")
if(WIN32)
otr_inst2(. FILES "${CMAKE_SOURCE_DIR}/bin/qt.conf")
otr_inst2(. FILES "${CMAKE_SOURCE_DIR}/bin/cleye.config")
otr_inst2(${opentrack-hier-pfx} FILES "${CMAKE_SOURCE_DIR}/bin/cleye.config")
endif()
otr_inst2("${opentrack-doc-pfx}" FILES ${CMAKE_SOURCE_DIR}/README.md)
otr_inst2("${opentrack-hier-pfx}" FILES "${CMAKE_SOURCE_DIR}/bin/freetrackclient.dll")
otr_inst2("${opentrack-hier-pfx}" FILES
"${CMAKE_SOURCE_DIR}/bin/NPClient.dll"
"${CMAKE_SOURCE_DIR}/bin/NPClient64.dll"
"${CMAKE_SOURCE_DIR}/bin/TrackIR.exe")
otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/CMakeLists.txt")
otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/README.md")
otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/CONTRIBUTING.md")
otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/WARRANTY.txt")
otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/OPENTRACK-LICENSING.txt")
otr_inst2("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/AUTHORS.md")
function(merge_translations)
install(CODE "file(REMOVE_RECURSE \"\${CMAKE_INSTALL_PREFIX}/i18n\")")
set(all-ts-files "")
set(all-qm-files "")
foreach(i ${opentrack-all-translations})
get_property(ts-files GLOBAL PROPERTY "opentrack-ts-files-${i}")
#get_property(ts-deps GLOBAL PROPERTY "opentrack-ts-targets-${i}")
set(ts-files_ "")
foreach(k ${ts-files})
if(EXISTS "${k}")
list(APPEND ts-files_ "${k}")
endif()
endforeach()
set(ts-files "${ts-files_}")
foreach(k ${ts-files})
list(APPEND all-ts-files "${k}")
endforeach()
if(NOT ".${ts-files}" STREQUAL ".")
set(lrelease-deps "${ts-files}")
set(qm-output "${CMAKE_CURRENT_BINARY_DIR}/${i}.qm")
list(APPEND all-qm-files "${qm-output}")
add_custom_command(OUTPUT "${qm-output}"
COMMAND "${Qt5_DIR}/../../../bin/lrelease" -nounfinished -silent ${ts-files} -qm "${qm-output}"
DEPENDS ${lrelease-deps}
COMMENT "Running lrelease for ${i}")
set(lang-target "i18n-lang-${i}")
install(FILES "${qm-output}" DESTINATION "${opentrack-i18n-pfx}" RENAME "${i}.qm" ${opentrack-perms})
endif()
endforeach()
add_custom_target(i18n ALL DEPENDS ${all-qm-files})
add_custom_target(force-i18n DEPENDS ${all-ts-files} ${all-qm-files} i18n)
endfunction()
|