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)
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}")
23 "${BOOTSTRAP}/FarEng.hlf"
24 "${BOOTSTRAP}/FarRus.hlf"
25 "${BOOTSTRAP}/FarHun.hlf"
26 "${BOOTSTRAP}/FarUkr.hlf"
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
87 COMMAND "cp" "${BOOTSTRAP}/*.lng" "${INSTALL_DIR}"
90 add_custom_command(TARGET bootstrap
93 COMMAND "cp" "${BOOTSTRAP}/*.hlf" "${INSTALL_DIR}"
96 add_custom_command(TARGET bootstrap
98 COMMAND "cp" "${CMAKE_CURRENT_SOURCE_DIR}/*.sh" "${INSTALL_DIR}"
99 COMMAND "cp" "${CMAKE_CURRENT_SOURCE_DIR}/*.ini" "${INSTALL_DIR}"