forked from opentx/opentx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
94 changed files
with
1,578 additions
and
981 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
project(OpenTX) | ||
|
||
set(VERSION_MAJOR "2") | ||
set(VERSION_MINOR "2") | ||
set(VERSION_REVISION "0") | ||
set(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX}) | ||
set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR}) | ||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX}) | ||
message(STATUS "OpenTX ${VERSION}") | ||
|
||
cmake_minimum_required(VERSION 2.8) | ||
|
||
set(RADIO_DIRECTORY ${PROJECT_SOURCE_DIR}/radio) | ||
set(RADIO_SRC_DIRECTORY ${RADIO_DIRECTORY}/src) | ||
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src) | ||
|
||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake) | ||
include(Bitmaps) | ||
|
||
add_subdirectory(${RADIO_SRC_DIRECTORY}) | ||
add_subdirectory(${COMPANION_SRC_DIRECTORY}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
macro(add_bitmaps_target targetname filter width format) | ||
file(GLOB bitmaps ${filter}) | ||
foreach(bitmap ${bitmaps}) | ||
get_filename_component(target ${bitmap} NAME_WE) | ||
set(target ${target}.lbm) | ||
add_custom_command( | ||
OUTPUT ${target} | ||
COMMAND python ${RADIO_DIRECTORY}/util/img2lbm.py ${bitmap} ${target} ${width} ${format} | ||
DEPENDS ${bitmap} | ||
) | ||
list(APPEND bitmaps_files ${target}) | ||
endforeach() | ||
add_custom_target(${targetname} DEPENDS ${bitmaps_files}) | ||
endmacro(add_bitmaps_target) | ||
|
||
macro(add_truetype_font_target radio name font size) | ||
set(target ${RADIO_SRC_DIRECTORY}/fonts/${radio}/font_${name}) | ||
add_custom_command( | ||
OUTPUT ${target}.png | ||
OUTPUT ${target}.specs | ||
COMMAND ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} False ${target} | ||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} | ||
) | ||
add_custom_target(ttf_${radio}_${name} DEPENDS ${target}.png ${target}.specs) | ||
endmacro(add_truetype_font_target) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
macro(today RESULT) | ||
if(WIN32) | ||
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT}) | ||
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}}) | ||
elseif(UNIX) | ||
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT}) | ||
string(REGEX REPLACE "(....)-(..)-(..).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}}) | ||
else(WIN32) | ||
message(SEND_ERROR "date not implemented") | ||
set(${RESULT} 00.00.0000) | ||
endif(WIN32) | ||
endmacro(today) | ||
|
||
macro(now RESULT) | ||
if(WIN32) | ||
execute_process(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT}) | ||
string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}}) | ||
elseif(UNIX) | ||
execute_process(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT}) | ||
string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}}) | ||
else(WIN32) | ||
message(SEND_ERROR "time not implemented") | ||
set(${RESULT} 00:00:00) | ||
endif(WIN32) | ||
endmacro(now) | ||
|
||
macro(git_id RESULT) | ||
if(WIN32) | ||
execute_process(COMMAND "cmd" " /C git --git-dir=${PROJECT_SOURCE_DIR}/.git rev-parse HEAD" OUTPUT_VARIABLE ${RESULT}) | ||
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}}) | ||
elseif(UNIX) | ||
execute_process(COMMAND "git" "--git-dir=${PROJECT_SOURCE_DIR}/.git" "rev-parse" "HEAD" OUTPUT_VARIABLE ${RESULT}) | ||
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}}) | ||
else(WIN32) | ||
message(SEND_ERROR "Git ID implemented") | ||
set(${RESULT} 0) | ||
endif(WIN32) | ||
endmacro(git_id) |
Oops, something went wrong.