Help: TTY|a, TTY|Xa, TTY|k, TTY|Xk and TTY|w, TTY|Xw Backends
[far2l.git] / far2l / bootstrap / CMakeLists.txt
blobde53d98ddd719cecb98adf2fbc3c0e341595f85e
1 cmake_minimum_required (VERSION 3.0.2)
3 add_custom_target(bootstrap 
4     DEPENDS farlang.templ lang.inc
7 message(STATUS "generating headers and languages")
9 if (CMAKE_SIZEOF_VOID_P EQUAL 8)
10     set(LBITS 64)
11     set(DIRBIT 64)
12 else ()
13     set(LBITS 32)
14     set(DIRBIT 32)
15 endif ()
17 set(BOOTSTRAP "${PROJECT_BINARY_DIR}/bootstrap")
18 set(SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/scripts")
20 set(M4PL ${SCRIPTS}/far2l_m4.pl "${VERSION_MAJOR}" "${VERSION_MINOR}" "${VERSION_PATCH}" "${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}")
22 set(HLFFILES
23     "${BOOTSTRAP}/FarEng.hlf"
24     "${BOOTSTRAP}/FarRus.hlf"
25     "${BOOTSTRAP}/FarHun.hlf"
26     "${BOOTSTRAP}/FarUkr.hlf"
28 set(LNGFILES
29     "${BOOTSTRAP}/FarEng.lng"
30     "${BOOTSTRAP}/FarRus.lng"
31     "${BOOTSTRAP}/FarHun.lng"
32     "${BOOTSTRAP}/FarUkr.lng"
35 add_custom_command(OUTPUT "${BOOTSTRAP}/farlang.templ"
36     COMMAND cat "${SCRIPTS}/farlang.templ.m4" | perl -I. ${M4PL} > "${BOOTSTRAP}/farlang.templ"
37     WORKING_DIRECTORY "${SCRIPTS}"
38     DEPENDS ${DEPENDENCIES} "${SCRIPTS}/farlang.templ.m4" "${SCRIPTS}/far2l_m4.pl"
39     COMMENT generating language template
42 add_custom_command(OUTPUT "${BOOTSTRAP}/lang.inc"
43     COMMAND perl -I. "${SCRIPTS}/farlng.pl" "${BOOTSTRAP}/farlang.templ" "${BOOTSTRAP}"
44     WORKING_DIRECTORY "${SCRIPTS}"
45     DEPENDS "${BOOTSTRAP}/farlang.templ"
46     COMMENT generating languages
49 add_custom_command(TARGET bootstrap PRE_BUILD
50     COMMAND perl -I. "${SCRIPTS}/farver.pl" "${BOOTSTRAP}/farversion.inc" "${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}" "${VERSION_MAJOR}" "${VERSION_MINOR}" "${VERSION_PATCH}"
51     WORKING_DIRECTORY "${SCRIPTS}"
52     COMMENT generating version information
55 add_custom_command(TARGET bootstrap
56     COMMAND perl -I. "${SCRIPTS}/mkhlf.pl" "${SCRIPTS}/FarEng.hlf.m4" | perl ${M4PL} > "${BOOTSTRAP}/FarEng.hlf"
58     WORKING_DIRECTORY "${SCRIPTS}"
59     DEPENDS ${DEPENDENCIES}
60     COMMENT generating help eng
62 add_custom_command(TARGET bootstrap
63     COMMAND perl -I. "${SCRIPTS}/mkhlf.pl" "${SCRIPTS}/FarRus.hlf.m4" | perl ${M4PL} > "${BOOTSTRAP}/FarRus.hlf"
64     WORKING_DIRECTORY "${SCRIPTS}"
65     DEPENDS ${DEPENDENCIES}
66     COMMENT generating help rus
68 add_custom_command(TARGET bootstrap
69     COMMAND perl -I. "${SCRIPTS}/mkhlf.pl" "${SCRIPTS}/FarHun.hlf.m4" | perl ${M4PL} > "${BOOTSTRAP}/FarHun.hlf"
70     WORKING_DIRECTORY "${SCRIPTS}"
71     DEPENDS ${DEPENDENCIES}
72     COMMENT generating help hun
74 add_custom_command(TARGET bootstrap
75     COMMAND perl -I. "${SCRIPTS}/mkhlf.pl" "${SCRIPTS}/FarUkr.hlf.m4" | perl ${M4PL} > "${BOOTSTRAP}/FarUkr.hlf"
76     WORKING_DIRECTORY "${SCRIPTS}"
77     DEPENDS ${DEPENDENCIES}
78     COMMENT generating help ukr
81 # older cmake versions does not support copying of multiple files,
82 # so we use simple stupid /bin/cp and wildcards
84 add_custom_command(TARGET bootstrap
85     POST_BUILD
86     DEPENDS "${LNGFILES}"
87     COMMAND "cp" "${BOOTSTRAP}/*.lng" "${INSTALL_DIR}"
90 add_custom_command(TARGET bootstrap
91     POST_BUILD
92     DEPENDS "${HLFFILES}"
93     COMMAND "cp" "${BOOTSTRAP}/*.hlf" "${INSTALL_DIR}"
96 add_custom_command(TARGET bootstrap
97     POST_BUILD
98     COMMAND "cp" "${CMAKE_CURRENT_SOURCE_DIR}/*.sh" "${INSTALL_DIR}"
99     COMMAND "cp" "${CMAKE_CURRENT_SOURCE_DIR}/*.ini" "${INSTALL_DIR}"