1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-16 21:05:26 +03:00

Make build setup a little more Windows-friendly (#4435)

* [build][CMake] Use `find_package(Git)` to confirm existence before trying to use git for version stamp; Use friendlier detection of grep executable on Windows; Use "del" on Windows instead of "rm".

* [build][Windows] Include dirent and msinttypes headers in source tree.

* Remove grep dependency for lua exports generation

* Sneaky pythons hiding in code.

* [build] Change `git_id` macro to skip check if no git directory is present, also now fails gracefully; Fix `today` macro on Windows; Report git revision; Make sure QtSvg module is found.
This commit is contained in:
Max Paperno 2017-02-11 16:23:07 -05:00 committed by Bertrand Songis
parent e80c4c858e
commit 3542c8b807
11 changed files with 1665 additions and 50 deletions

View file

@ -1,14 +1,10 @@
macro(add_lua_export_target target)
if(PYTHONINTERP_FOUND)
add_custom_command(
OUTPUT lua_exports_${target}.inc
COMMAND ${CMAKE_C_COMPILER} -E ${ARGN} -DEXPORT ${RADIO_SRC_DIRECTORY}/dataconstants.h > lua_exports_${target}.tmp
COMMAND grep LEXP lua_exports_${target}.tmp > lua_exports_${target}.txt
COMMAND rm lua_exports_${target}.tmp
COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/luaexport.py ${VERSION} lua_exports_${target}.txt lua_exports_${target}.inc lua_fields_${target}.txt
add_custom_command(
OUTPUT lua_exports_${target}.inc
COMMAND ${CMAKE_C_COMPILER} -E ${ARGN} -DEXPORT ${RADIO_SRC_DIRECTORY}/dataconstants.h > lua_exports_${target}.txt
COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/luaexport.py ${VERSION} lua_exports_${target}.txt lua_exports_${target}.inc lua_fields_${target}.txt
)
endif()
add_custom_target(lua_export_${target} DEPENDS lua_exports_${target}.inc)
endmacro(add_lua_export_target)
@ -43,8 +39,10 @@ set(LUA_INCLUDES_STM32F4
-I${RADIO_SRC_DIRECTORY}/${STM32LIB_DIR}/CMSIS/Device/ST/STM32F4xx/Include
)
add_lua_export_target(x7 ${LUA_INCLUDES_STM32F2} -DPCBTARANIS -DPCBX7)
add_lua_export_target(x9d ${LUA_INCLUDES_STM32F2} -DPCBTARANIS -DPCBX9D)
add_lua_export_target(x9e ${LUA_INCLUDES_STM32F4} -DPCBTARANIS -DPCBX9E -DSTM32F40_41xxx)
add_lua_export_target(x10 ${LUA_INCLUDES_STM32F4} -DPCBHORUS -DPCBX10 -DSTM32F40_41xxx)
add_lua_export_target(x12s ${LUA_INCLUDES_STM32F4} -DPCBHORUS -DPCBX12S -DSTM32F40_41xxx)
if(PYTHONINTERP_FOUND)
add_lua_export_target(x7 ${LUA_INCLUDES_STM32F2} -DPCBTARANIS -DPCBX7)
add_lua_export_target(x9d ${LUA_INCLUDES_STM32F2} -DPCBTARANIS -DPCBX9D)
add_lua_export_target(x9e ${LUA_INCLUDES_STM32F4} -DPCBTARANIS -DPCBX9E -DSTM32F40_41xxx)
add_lua_export_target(x10 ${LUA_INCLUDES_STM32F4} -DPCBHORUS -DPCBX10 -DSTM32F40_41xxx)
add_lua_export_target(x12s ${LUA_INCLUDES_STM32F4} -DPCBHORUS -DPCBX12S -DSTM32F40_41xxx)
endif()